ketoctx

package
v0.13.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Options

func Options(options ...Option) *opts

Types

type Contextualizer

type Contextualizer interface {
	Network(ctx context.Context, network uuid.UUID) uuid.UUID
	Config(ctx context.Context, config *configx.Provider) *configx.Provider
}

type ContextualizerProvider

type ContextualizerProvider interface {
	Contextualizer() Contextualizer
}

type DefaultContextualizer

type DefaultContextualizer struct{}

func (*DefaultContextualizer) Config

func (*DefaultContextualizer) Network

func (d *DefaultContextualizer) Network(_ context.Context, network uuid.UUID) uuid.UUID

type Option

type Option func(o *opts)

func WithContextualizer

func WithContextualizer(ctxer Contextualizer) Option

WithContextualizer sets the contextualizer.

func WithExtraMigrations

func WithExtraMigrations(o ...fs.FS) Option

WithExtraMigrations adds additional database migrations.

func WithGRPCStreamInterceptors

func WithGRPCStreamInterceptors(i ...grpc.StreamServerInterceptor) Option

WithGRPCStreamInterceptors adds gRPC stream interceptors to the list of gRPC stream interceptors.

func WithGRPCUnaryInterceptors

func WithGRPCUnaryInterceptors(i ...grpc.UnaryServerInterceptor) Option

WithGRPCUnaryInterceptors adds gRPC unary interceptors to the list of gRPC interceptors.

func WithHTTPMiddlewares

func WithHTTPMiddlewares(m ...func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)) Option

WithHTTPMiddlewares adds HTTP middlewares to the list of HTTP middlewares.

func WithLogger

func WithLogger(l *logrusx.Logger) Option

WithLogger sets the logger.

func WithMigrationOptions

func WithMigrationOptions(o ...popx.MigrationBoxOption) Option

WithMigrationOptions adds migration options to the list of migration options.

func WithReadinessCheck

func WithReadinessCheck(name string, rc healthx.ReadyChecker) Option

WithReadinessCheck adds a new readness health checker to the list of checkers. Can be called multiple times. If the name is already taken, the checker will be overwritten.

func WithTracerWrapper

func WithTracerWrapper(wrapper TracerWrapper) Option

WithTracerWrapper sets a function that wraps the tracer.

type TracerWrapper

type TracerWrapper func(*otelx.Tracer) *otelx.Tracer

Jump to

Keyboard shortcuts

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