summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/fetcher.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-05 14:45:56 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-01-05 14:45:56 (GMT)
commitff149324fb78e2cb0ae2484c79c052f38c27d4d2 (patch)
treeeaf95faf61be86ef278cdbcaf6701f0a400cb65a /src/helsinki.at/rhimport/fetcher.go
parentf390aaa79bef626f69ced73b3eeb1f1ffea93c6d (diff)
removed Import prefix of some types
Diffstat (limited to 'src/helsinki.at/rhimport/fetcher.go')
-rw-r--r--src/helsinki.at/rhimport/fetcher.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/helsinki.at/rhimport/fetcher.go b/src/helsinki.at/rhimport/fetcher.go
index f5d5420..66c91a5 100644
--- a/src/helsinki.at/rhimport/fetcher.go
+++ b/src/helsinki.at/rhimport/fetcher.go
@@ -86,7 +86,7 @@ func curlWriteCallback(ptr []byte, userdata interface{}) bool {
return true
}
-func fetchFileCurl(ctx *ImportContext, res *ImportResult, uri *url.URL) (err error) {
+func fetchFileCurl(ctx *Context, res *Result, uri *url.URL) (err error) {
rhl.Printf("curl-based fetcher called for '%s'", ctx.SourceUri)
easy := curl.EasyInit()
@@ -150,7 +150,7 @@ func fetchFileCurl(ctx *ImportContext, res *ImportResult, uri *url.URL) (err err
return
}
-func fetchFileLocal(ctx *ImportContext, res *ImportResult, uri *url.URL) (err error) {
+func fetchFileLocal(ctx *Context, res *Result, 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 {
@@ -187,7 +187,7 @@ func fetchFileLocal(ctx *ImportContext, res *ImportResult, uri *url.URL) (err er
return
}
-func fetchFileFake(ctx *ImportContext, res *ImportResult, uri *url.URL) error {
+func fetchFileFake(ctx *Context, res *Result, uri *url.URL) error {
rhdl.Printf("Fake fetcher for '%s'", ctx.SourceUri)
if duration, err := strconv.ParseUint(uri.Host, 10, 32); err != nil {
@@ -221,7 +221,7 @@ func fetchFileFake(ctx *ImportContext, res *ImportResult, uri *url.URL) error {
return nil
}
-type FetchFunc func(*ImportContext, *ImportResult, *url.URL) (err error)
+type FetchFunc func(*Context, *Result, *url.URL) (err error)
// TODO: implement fetchers for:
// archiv://
@@ -257,7 +257,7 @@ func fetcherInit() {
}
}
-func checkPassword(ctx *ImportContext, result *ImportResult) (err error) {
+func checkPassword(ctx *Context, result *Result) (err error) {
ok := false
if ok, err = ctx.rddb.CheckPassword(ctx.UserName, ctx.Password); err != nil {
return
@@ -269,8 +269,8 @@ func checkPassword(ctx *ImportContext, result *ImportResult) (err error) {
return
}
-func FetchFile(ctx *ImportContext) (res *ImportResult, err error) {
- res = &ImportResult{ResponseCode: http.StatusOK}
+func FetchFile(ctx *Context) (res *Result, err error) {
+ res = &Result{ResponseCode: http.StatusOK}
var uri *url.URL
if uri, err = url.Parse(ctx.SourceUri); err != nil {