dependency

package
v1.0.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithDatabase

func ContextWithDatabase(ctx context.Context, label string, db godb.Database) context.Context

ConextWithDatabase returns a context containing the provided database.

func ContextWithElasticsearch added in v1.0.70

func ContextWithElasticsearch(ctx context.Context, es *elasticsearch.Client) context.Context

ConextWithElasticsearch returns a context containing the provided elasticsearch client.

func ContextWithRedis added in v1.0.73

func ContextWithRedis(ctx context.Context, rdb *redis.Client) context.Context

ConextWithRedis returns a context containing the provided redis client.

func DBFromContext

func DBFromContext(ctx context.Context, label string) godb.Database

func DatabaseDependencyHandler

func DatabaseDependencyHandler(label string, db godb.Database) func(http.Handler) http.Handler

DatabaseDependencyHandler is a middleware to inject a database into context.

func ESFromContext added in v1.0.70

func ESFromContext(ctx context.Context) *elasticsearch.Client

func ElasticsearchDependencyHandler added in v1.0.70

func ElasticsearchDependencyHandler(es *elasticsearch.Client) func(http.Handler) http.Handler

ElasticsearchDependencyHandler is a middleware to inject an elasticsearch.Client into context.

func RDBFromContext added in v1.0.73

func RDBFromContext(ctx context.Context) *redis.Client

func RedisDependencyHandler added in v1.0.73

func RedisDependencyHandler(rdb *redis.Client) func(http.Handler) http.Handler

RedisDependencyHandler is a middleware to inject a redis.Client into context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL