dependency

package
v1.1.35 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 8 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 ContextWithElasticsearchV6 added in v1.0.75

func ContextWithElasticsearchV6(ctx context.Context, es *elasticsearch6.Client) context.Context

ContextWithElasticsearchV6 returns a context containing the provided elasticsearch client.

func ContextWithElasticsearchV7 added in v1.0.75

func ContextWithElasticsearchV7(ctx context.Context, es *elasticsearch7.Client) context.Context

ContextWithElasticsearchV7 returns a context containing the provided elasticsearch client.

func ContextWithOpensearch added in v1.1.28

func ContextWithOpensearch(ctx context.Context, search *opensearch.Client) context.Context

ContextWithOpensearch returns a context containing the provided opensearch client.

func ContextWithRedis added in v1.0.73

func ContextWithRedis(ctx context.Context, rdb redis.Cache) context.Context

ConextWithRedis returns a context containing the provided redis client.

func ContextWithRequestor added in v1.1.19

func ContextWithRequestor(ctx context.Context, label string, req httputil.Requestor) context.Context

ContextWithRequestor returns a context containing the provided requestor.

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 ESV6FromContext added in v1.0.75

func ESV6FromContext(ctx context.Context) *elasticsearch6.Client

ESV6FromContext gets an elasticsearch client from a context.

func ESV7FromContext added in v1.0.75

func ESV7FromContext(ctx context.Context) *elasticsearch7.Client

ESV7FromContext gets an elasticsearch client from a context.

func ElasticsearchV6DependencyHandler added in v1.0.75

func ElasticsearchV6DependencyHandler(es *elasticsearch6.Client) func(http.Handler) http.Handler

ElasticsearchV6DependencyHandler is a middleware to inject an elasticsearchv6.Client into context.

func ElasticsearchV7DependencyHandler added in v1.0.75

func ElasticsearchV7DependencyHandler(es *elasticsearch7.Client) func(http.Handler) http.Handler

ElasticsearchV7DependencyHandler is a middleware to inject an elasticsearchv7.Client into context.

func OpensearchDependencyHandler added in v1.1.29

func OpensearchDependencyHandler(search *opensearch.Client) func(http.Handler) http.Handler

OpensearchDependencyHandler is a middleware to inject an opensearch.Client into context.

func OpensearchFromContext added in v1.1.28

func OpensearchFromContext(ctx context.Context) *opensearch.Client

OpensearchFromContext gets an opensearch client from a context.

func RDBFromContext added in v1.0.73

func RDBFromContext(ctx context.Context) redis.Cache

func RedisDependencyHandler added in v1.0.73

func RedisDependencyHandler(rdb redis.Cache) func(http.Handler) http.Handler

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

func RequestorDependencyHandler added in v1.1.19

func RequestorDependencyHandler(label string, req httputil.Requestor) func(http.Handler) http.Handler

RequestorDependencyHandler is a middleware to inject a requestor into context.

func RequestorFromContext added in v1.1.19

func RequestorFromContext(ctx context.Context, label string) httputil.Requestor

RequestorFromContext returns a requestor from a context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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