// GraphiteWithConfig is a blocking exporter function just like Graphite,
// but it takes a GraphiteConfig instead.
424795
func GraphiteWithConfig(c GraphiteConfig) {
	log.Printf("WARNING: This go-metrics client has been DEPRECATED! It has been moved to https://github.com/cyberdelia/go-metrics-graphite and will be removed from rcrowley/go-metrics on August 12th 2015")
	for range time.Tick(c.FlushInterval) {
		if err := graphite(&c); nil != err {
			log.Println(err)
		}
	}
}
405476
func WithOption(key, value string) func(*types.NetworkCreate) {
	return func(n *types.NetworkCreate) {
		if n.Options == nil {
			n.Options = map[string]string{}
		}
		n.Options[key] = value
	}
}
996128
func (c *Config) WithLogLevel(level LogLevelType) *Config {
	c.LogLevel = &level
	return c
}
692324
func OpenWithConfiguration(c Configuration) (*sql.DB, error) {
	json, err := c.toJSON()
	if err != nil {
		return nil, err
	}
	return sql.Open("vitess", json)
}
341750
func WithDecompressor(d grpc.Decompressor) Option {
	return func(o *options) {
		o.decompressor = d
	}
}
140729
func WithCorePkg(core sdkApi.CoreProviderFactory) Option {
	return func(opts *options) error {
		opts.Core = core
		return nil
	}
}
476816
func (r *ProxyRequest) WithCompilerMappings(mappings flux.CompilerMappings) {
	r.Request.WithCompilerMappings(mappings)
}
90880
func WithCompressor(c grpc.Compressor) Option {
	return func(o *options) {
		o.compressor = c
	}
}
957823
func (c *Config) WithRegion(region string) *Config {
	c.Region = &region
	return c
}
666622
func WithCompactionPlanner(planner tsm1.CompactionPlanner) Option {
	return func(e *Engine) {
		e.engine.WithCompactionPlanner(planner)
	}
}
496677
func WithConfigPath(s string) source.Option {
	return func(o *source.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, configPathKey{}, s)
	}
}
1167590
func WithMax(cfg Config, max time.Duration, defaultLayout string) Config {
	n := cfg
	n.Max = max
	n.DefaultLayout = defaultLayout
	return n
}
1067257
func WithCreateOptions(opts map[string]string) CreateOption {
	return func(cfg *CreateConfig) {
		cfg.Options = opts
	}
}
1080184
func NewGraphiteWithMetricPrefix(host string, port int, prefix string) (*Graphite, error) {
	return GraphiteFactory("tcp", host, port, prefix)
}
780843
func InitWithOptions(conf interface{}, opts Options) error {
	value := reflect.ValueOf(conf)
	if value.Kind() != reflect.Ptr {
		return ErrNotAPointer
	}

	elem := value.Elem()

	ctx := context{
		name:            opts.Prefix,
		optional:        opts.AllOptional,
		leaveNil:        opts.LeaveNil,
		allowUnexported: opts.AllowUnexported,
	}
	switch elem.Kind() {
	case reflect.Ptr:
		if elem.IsNil() {
			elem.Set(reflect.New(elem.Type().Elem()))
		}
		_, err := readStruct(elem.Elem(), &ctx)
		return err
	case reflect.Struct:
		_, err := readStruct(elem, &ctx)
		return err
	default:
		return ErrInvalidValueKind
	}
}
476509
func NewAppWithConfig(config AppConfig) (*App, error) {

	if err := applyDefaults(&config); err != nil {
		return nil, errors.Wrap(err, "while applying config defaults")
	}

	// Connect to etcd and fetch registration config
	if err := fetchEtcdConfig(&config); err != nil {
		return nil, errors.Wrap(err, "while fetching etcd config")
	}

	app := App{Config: config}

	if LogRequest == nil {
		LogRequest = logRequest
	}

	app.router = config.Router
	if app.router == nil {
		app.router = mux.NewRouter()
		app.router.UseEncodedPath()
	}
	app.router.HandleFunc("/_ping", handlePing).Methods("GET")

	if config.Vulcand != nil {
		var err error
		app.vulcandReg, err = vulcand.NewRegistry(*config.Vulcand, config.Name, config.ListenIP, config.ListenPort)
		if err != nil {
			return nil, err
		}
	}

	app.stats = newAppStats(config.Client)
	return &app, nil
}
1185902
func (ks *KeyServerLocal) CopyWithConfigAndLogger(
	config KeyServerConfig, log logger.Logger) *KeyServerLocal {
	return &KeyServerLocal{
		config, ks.db, log, ks.shutdownLock, ks.shutdown, ks.shutdownFunc}
}