Example #1
0
// Source - Adds actions sources to a worker core.
func (w *Worker) Source(address string, authorization ...string) (err error) {
	src, err := source.Create(address, authorization...)
	if err != nil {
		return
	}
	w.Core.Sources.More(src)
	return nil
}
Example #2
0
// Source - Creates a source from address that should be a valid url like `file://actions` or `http://actions.com/`.
func (core *Core) Source(address string, authorization ...string) (err error) {
	src, err := source.Create(address, authorization...)
	if err != nil {
		glog.Warningf("source %#v error: %v", address, err)
		return
	}
	glog.V(3).Infof("New source %s", address)
	core.Sources.More(src)
	return
}