Documentation ¶
Index ¶
- func ContextWithDatabase(ctx context.Context, label string, db godb.Database) context.Context
- func ContextWithElasticsearch(ctx context.Context, es *elasticsearch.Client) context.Context
- func ContextWithRedis(ctx context.Context, rdb *redis.Client) context.Context
- func DBFromContext(ctx context.Context, label string) godb.Database
- func DatabaseDependencyHandler(label string, db godb.Database) func(http.Handler) http.Handler
- func ESFromContext(ctx context.Context) *elasticsearch.Client
- func ElasticsearchDependencyHandler(es *elasticsearch.Client) func(http.Handler) http.Handler
- func RDBFromContext(ctx context.Context) *redis.Client
- func RedisDependencyHandler(rdb *redis.Client) func(http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithDatabase ¶
ConextWithDatabase returns a context containing the provided database.
func ContextWithElasticsearch ¶ added in v1.0.70
ConextWithElasticsearch returns a context containing the provided elasticsearch client.
func ContextWithRedis ¶ added in v1.0.73
ConextWithRedis returns a context containing the provided redis client.
func DatabaseDependencyHandler ¶
DatabaseDependencyHandler is a middleware to inject a database into context.
func ESFromContext ¶ added in v1.0.70
func ElasticsearchDependencyHandler ¶ added in v1.0.70
ElasticsearchDependencyHandler is a middleware to inject an elasticsearch.Client into context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.