summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/fetcher.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-31 09:46:40 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-31 09:46:40 (GMT)
commit0ef8fcb03fc4f51b8bc6b1a24f2e964b6a03d50c (patch)
treed065a87002893b693e17f2fe503a6f9631564c2b /src/helsinki.at/rhimport/fetcher.go
parent620d1b76807f6ecffda54347db7b58107d03c2a5 (diff)
improved coding style
Diffstat (limited to 'src/helsinki.at/rhimport/fetcher.go')
-rw-r--r--src/helsinki.at/rhimport/fetcher.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/helsinki.at/rhimport/fetcher.go b/src/helsinki.at/rhimport/fetcher.go
index f1bbb5e..55b814c 100644
--- a/src/helsinki.at/rhimport/fetcher.go
+++ b/src/helsinki.at/rhimport/fetcher.go
@@ -91,7 +91,7 @@ func curlWriteCallback(ptr []byte, userdata interface{}) bool {
return true
}
-func FetchFileCurl(ctx *ImportContext, res *FetchResult, uri *url.URL) (err error) {
+func fetchFileCurl(ctx *ImportContext, res *FetchResult, uri *url.URL) (err error) {
rhl.Printf("curl-based fetcher called for '%s'", ctx.SourceUri)
easy := curl.EasyInit()
@@ -155,7 +155,7 @@ func FetchFileCurl(ctx *ImportContext, res *FetchResult, uri *url.URL) (err erro
return
}
-func FetchFileLocal(ctx *ImportContext, res *FetchResult, uri *url.URL) (err error) {
+func fetchFileLocal(ctx *ImportContext, res *FetchResult, uri *url.URL) (err error) {
rhl.Printf("Local fetcher called for '%s'", ctx.SourceUri)
if ctx.ProgressCallBack != nil {
if keep := ctx.ProgressCallBack(1, "fetching", 0.0, ctx.ProgressCallBackData); !keep {
@@ -192,7 +192,7 @@ func FetchFileLocal(ctx *ImportContext, res *FetchResult, uri *url.URL) (err err
return
}
-func FetchFileFake(ctx *ImportContext, res *FetchResult, uri *url.URL) error {
+func fetchFileFake(ctx *ImportContext, res *FetchResult, uri *url.URL) error {
rhdl.Printf("Fake fetcher for '%s'", ctx.SourceUri)
if duration, err := strconv.ParseUint(uri.Host, 10, 32); err != nil {
@@ -234,28 +234,28 @@ type FetchFunc func(*ImportContext, *FetchResult, *url.URL) (err error)
// home:// ?????
var (
fetchers = map[string]FetchFunc{
- "local": FetchFileLocal,
- "fake": FetchFileFake,
+ "local": fetchFileLocal,
+ "fake": fetchFileFake,
}
- curl_protos = map[string]bool{
+ curlProtos = map[string]bool{
"http": false, "https": false,
"ftp": false, "ftps": false,
}
)
-func fetcher_init() {
+func fetcherInit() {
info := curl.VersionInfo(curl.VERSION_FIRST)
protos := info.Protocols
for _, proto := range protos {
- if _, ok := curl_protos[proto]; ok {
+ if _, ok := curlProtos[proto]; ok {
rhdl.Printf("curl: enabling protocol %s", proto)
- fetchers[proto] = FetchFileCurl
- curl_protos[proto] = true
+ fetchers[proto] = fetchFileCurl
+ curlProtos[proto] = true
} else {
rhdl.Printf("curl: ignoring protocol %s", proto)
}
}
- for proto, enabled := range curl_protos {
+ for proto, enabled := range curlProtos {
if !enabled {
rhl.Printf("curl: protocol %s is disabled because the installed library version doesn't support it!", proto)
}