diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-01-05 14:45:56 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-01-05 14:45:56 (GMT) |
commit | ff149324fb78e2cb0ae2484c79c052f38c27d4d2 (patch) | |
tree | eaf95faf61be86ef278cdbcaf6701f0a400cb65a /src/helsinki.at/rhimport/core.go | |
parent | f390aaa79bef626f69ced73b3eeb1f1ffea93c6d (diff) |
removed Import prefix of some types
Diffstat (limited to 'src/helsinki.at/rhimport/core.go')
-rw-r--r-- | src/helsinki.at/rhimport/core.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/helsinki.at/rhimport/core.go b/src/helsinki.at/rhimport/core.go index bb92d30..9927be9 100644 --- a/src/helsinki.at/rhimport/core.go +++ b/src/helsinki.at/rhimport/core.go @@ -51,17 +51,17 @@ func init() { fetcherInit() } -type ImportProgressCB func(step int, stepName string, progress float64, userdata interface{}) bool -type ImportDoneCB func(ImportResult, interface{}) bool +type ProgressCB func(step int, stepName string, progress float64, userdata interface{}) bool +type DoneCB func(Result, interface{}) bool -type ImportResult struct { +type Result struct { ResponseCode int ErrorString string Cart uint Cut uint } -type ImportContext struct { +type Context struct { conf *Config rddb *RdDbChan UserName string @@ -81,13 +81,13 @@ type ImportContext struct { SourceFile string DeleteSourceFile bool DeleteSourceDir bool - ProgressCallBack ImportProgressCB + ProgressCallBack ProgressCB ProgressCallBackData interface{} Cancel <-chan bool } -func NewImportContext(conf *Config, rddb *RdDbChan, user string) *ImportContext { - ctx := new(ImportContext) +func NewContext(conf *Config, rddb *RdDbChan, user string) *Context { + ctx := new(Context) ctx.conf = conf ctx.rddb = rddb ctx.UserName = user @@ -112,7 +112,7 @@ func NewImportContext(conf *Config, rddb *RdDbChan, user string) *ImportContext return ctx } -func (ctx *ImportContext) SanityCheck() error { +func (ctx *Context) SanityCheck() error { if ctx.UserName == "" { return fmt.Errorf("empty Username is not allowed") } @@ -156,28 +156,28 @@ func (ctx *ImportContext) SanityCheck() error { return nil } -func (ctx *ImportContext) getPassword(cached bool) (err error) { +func (ctx *Context) getPassword(cached bool) (err error) { ctx.Password, err = ctx.rddb.GetPassword(ctx.UserName, cached) return } -func (ctx *ImportContext) getGroupOfCart() (err error) { +func (ctx *Context) getGroupOfCart() (err error) { ctx.GroupName, err = ctx.rddb.GetGroupOfCart(ctx.Cart) return } -func (ctx *ImportContext) getShowInfo() (carts []uint, err error) { +func (ctx *Context) getShowInfo() (carts []uint, err error) { ctx.GroupName, ctx.NormalizationLevel, ctx.AutotrimLevel, carts, err = ctx.rddb.GetShowInfo(ctx.ShowId) ctx.Channels = 2 ctx.UseMetaData = true return } -func (ctx *ImportContext) checkMusicGroup() (bool, error) { +func (ctx *Context) checkMusicGroup() (bool, error) { return ctx.rddb.CheckMusicGroup(ctx.GroupName) } -func (ctx *ImportContext) getMusicInfo() (err error) { +func (ctx *Context) getMusicInfo() (err error) { ctx.NormalizationLevel, ctx.AutotrimLevel, err = ctx.rddb.GetMusicInfo(ctx.GroupName) ctx.Channels = 2 ctx.UseMetaData = true |