package master import ( "analysis/app" "analysis/logo" "plugin" "basic.com/valib/pubsub.git" ) // Fetcher db type Fetcher struct { fnInit func(string, string, int, []string, string) (chan pubsub.Message, error) } // NewFetcher new func NewFetcher(soFile string) *Fetcher { plug, err := plugin.Open(soFile) if err != nil { logo.Errorln("Open: ", soFile, " error: ", err) return nil } fn, err := app.LoadFunc(plug, soFile, "Init") if err != nil { logo.Infoln("Lookup Func Init From File: ", soFile, " Error") return nil } fnInit := fn.(func(string, string, int, []string, string) (chan pubsub.Message, error)) return &Fetcher{ fnInit: fnInit, } }