// withConfig returns a new context with the given config.ConfigurationServer installed.
513529
func withConfig(c context.Context, cfg config.ConfigurationServer) context.Context {
	return context.WithValue(c, &cfgKey, cfg)
}
813621
func getConfig(c context.Context) config.ConfigurationServer {
	return c.Value(&cfgKey).(config.ConfigurationServer)
}
989095
func (o *CreateJSONWebKeySetParams) WithContext(ctx context.Context) *CreateJSONWebKeySetParams {
	o.SetContext(ctx)
	return o
}
1096744
func (o *PatchConfigParams) WithConfiguration(configuration *models.DaemonConfigurationSpec) *PatchConfigParams {
	o.SetConfiguration(configuration)
	return o
}
28260
func DialWithConfig(ctx context.Context, cfg *config.Config) (*Client, error) {
	options, err := configToOptions(cfg)
	if err != nil {
		return nil, err
	}
	return DialContext(ctx, options...)
}
1069828
func WithContext(ctx context.Context) func(*Client) error {
	return func(c *Client) error {
		c.Ctx = ctx
		return nil
	}
}
568811
func (o *GetJSONWebKeySetParams) WithContext(ctx context.Context) *GetJSONWebKeySetParams {
	o.SetContext(ctx)
	return o
}
279621
func (q *Query) WithContext(ctx context.Context) *Query {
	q.ctx = ctx
	return q
}
449321
func (builder *UpdateSetCommandBuilder) WithContext(context []byte) *UpdateSetCommandBuilder {
	builder.protobuf.Context = context
	return builder
}
346758
func (o *WellKnownParams) WithContext(ctx context.Context) *WellKnownParams {
	o.SetContext(ctx)
	return o
}
1293299
func (o *PetListParams) WithContext(ctx context.Context) *PetListParams {
	o.SetContext(ctx)
	return o
}
744010
func (db *Conn) WithContext(ctx context.Context) *Conn {
	return newConn(ctx, db.baseDB)
}
601861
func NewClientWithConfig(config Configuration) *Client {
	var hosts []*transport.StatefulHost

	if config.Hosts == nil {
		hosts = defaultHosts(config.Region)
	} else {
		for _, h := range config.Hosts {
			hosts = append(hosts, transport.NewStatefulHost(h, call.IsReadWrite))
		}
	}

	return &Client{
		appID: config.AppID,
		transport: transport.New(
			hosts,
			config.Requester,
			config.AppID,
			config.APIKey,
			config.ReadTimeout,
			config.WriteTimeout,
			config.Headers,
			config.ExtraUserAgent,
		),
	}
}
1327574
func (o *GetHelloParams) WithContext(ctx context.Context) *GetHelloParams {
	o.SetContext(ctx)
	return o
}
1200600
func MiddlewareWithConfig(config Config) echo.MiddlewareFunc {
	// Defaults
	if config.Skipper == nil {
		config.Skipper = DefaultConfig.Skipper
	}
	if config.Store == nil {
		panic("echo: session middleware requires store")
	}

	return func(next echo.HandlerFunc) echo.HandlerFunc {
		return func(c echo.Context) error {
			if config.Skipper(c) {
				return next(c)
			}
			defer context.Clear(c.Request())
			c.Set(key, config.Store)
			return next(c)
		}
	}
}
730018
func InitWithConfig(configs ...Config) error {
	for _, config := range configs {
		l, err := NewLogger(config)
		if err != nil {
			return err
		}
		gl.loggers = append(gl.loggers, l)
	}
	return nil
}
1055689
func (q *ModelQuery) WithContext(ctx context.Context) *ModelQuery {
	q.ctx = ctx
	return q
}