// Loader returns the option to set the loader function.
496572
func Loader(l CacheableLoader) Option {
	return func(c Cache) error {
		switch oc := c.(type) {
		case *cache:
			oc.load = l
			return nil
		default:
			return errors.New(ErrIllegalCache, errorMessages)
		}
	}
}
1309268
func Load(config interface{}, defaultValue interface{}, args []string) error {
	return LoadWithParsers(config, defaultValue, args, nil)
}
599462
func (s *GetLoadBalancerOutput) SetLoadBalancer(v *LoadBalancer) *GetLoadBalancerOutput {
	s.LoadBalancer = v
	return s
}
11012
func Logger(logger *zap.Logger) TransportOption {
	return func(t *transportOptions) {
		t.logger = logger
	}
}
1018779
func (l *propertiesLoader) Load(out interface{}) error {
	properties := make(p.Properties)
	if err := properties.Load(l.r); err != nil {
		return err
	}
	o := out.(*map[string]string)
	*o = map[string]string(properties)
	return nil
}
886414
func FileLoader() Reactor {
	return Reactive(func(v Reactor, err error, d interface{}) {
		if err != nil {
			v.ReplyError(err)
			return
		}

		var file string
		var ok bool

		if file, ok = d.(string); !ok {
			v.ReplyError(ErrValueType)
			return
		}

		var data []byte

		if data, err = ioutil.ReadFile(file); err != nil {
			v.ReplyError(err)
			return
		}

		v.Reply(string(data))
	})
}
1034607
func (m *Multi) AddLoaders(loaders ...jet.Loader) {
	m.loaders = append(m.loaders, loaders...)
}
415696
func NewBatchedLoader(batchFn BatchFunc, opts ...Option) *Loader {
	loader := &Loader{
		batchFn:  batchFn,
		inputCap: 1000,
		wait:     16 * time.Millisecond,
	}

	// Apply options
	for _, apply := range opts {
		apply(loader)
	}

	// Set defaults
	if loader.cache == nil {
		loader.cache = NewCache()
	}

	if loader.tracer == nil {
		loader.tracer = &NoopTracer{}
	}

	return loader
}
1053317
func WrapHandler(w ...server.HandlerWrapper) Option {
	return func(o *Options) {
		var wrappers []server.Option

		for _, wrap := range w {
			wrappers = append(wrappers, server.WrapHandler(wrap))
		}

		// Init once
		o.Server.Init(wrappers...)
	}
}
1341628
func (p *Plugin) Loader() (string, error) {
	templ := template.Must(template.New("provider").Parse(ftempl))

	var b bytes.Buffer
	writer := bufio.NewWriter(&b)

	err := templ.Execute(writer, p)
	writer.Flush()

	return string(b.Bytes()), err
}
158631
func NewUploader(cfg UploaderConfig) (*Uploader, error) {
	if err := cfg.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}

	ctx, cancel := context.WithCancel(cfg.Context)
	uploader := &Uploader{
		UploaderConfig: cfg,
		Entry: log.WithFields(log.Fields{
			trace.Component: teleport.ComponentAuditLog,
		}),
		cancel:    cancel,
		ctx:       ctx,
		semaphore: make(chan struct{}, cfg.ConcurrentUploads),
		scanDir:   filepath.Join(cfg.DataDir, cfg.ServerID, SessionLogsDir, cfg.Namespace),
	}
	return uploader, nil
}
36788
func Load(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "load", Listener: listener}
}
1235660
func Logger(l *log.Logger) optSetter {
	return func(s *Stream) error {
		s.log = l
		return nil
	}
}
345129
func Cacher(options ...Options) macaron.Handler {
	opt := prepareOptions(options)
	cache, err := NewCacher(opt.Adapter, opt)
	if err != nil {
		panic(err)
	}
	return func(ctx *macaron.Context) {
		ctx.Map(cache)
	}
}
929316
func (view *View) SetTemplateLoader(name string, path string) {
	loader := &TemplateManager{
		Loader: &FileSystemLoader{
			BaseDir: path,
		},
		FuncMap: view.FuncMap,
	}
	view.templateLoader[name] = loader
}
1170467
func New(name string) *Loader {
	return &Loader{
		Args:         os.Args[1:],
		Aliases:      map[string]string{},
		KeyParser:    DashSeparatorKeyParser,
		LoadDefaults: false,
		FlagSet:      flaglib.NewFlagSet(name, flaglib.ContinueOnError),
	}
}
1342715
func MemoryLoader(files map[string]string) Loader {
	return func(path string) (_ starlark.StringDict, src string, err error) {
		body, ok := files[path]
		if !ok {
			return nil, "", ErrNoModule
		}
		return nil, body, nil
	}
}