grpc_interceptor

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContextWithNamespace added in v0.5.0

func BuildContextWithNamespace(ctx context.Context, ns *namespace.Namespace) context.Context

func FetchNamespaceFromContext added in v0.5.0

func FetchNamespaceFromContext(ctx context.Context) *namespace.Namespace

FetchNamespaceFromContext if not found, fallback to default

func NamespaceUnaryInterceptor added in v0.5.0

func NamespaceUnaryInterceptor(service NamespaceService) grpc.UnaryServerInterceptor

NamespaceUnaryInterceptor namespace can be passed in jwt token or headers, if none provided it falls back to default

func StatsD

func StatsD(statsdReporter StatsDClient) grpc.UnaryServerInterceptor

func UserHeaderCtx

func UserHeaderCtx(IdentityHeaderKeyUUID, IdentityHeaderKeyEmail string) grpc.UnaryServerInterceptor

UserHeaderCtx middleware will propagate a valid user ID as string within request context use `user.FromContext` function to get the user ID string

Types

type NamespaceKey added in v0.5.0

type NamespaceKey struct{}

NamespaceKey is injected in context with the tenant context

type NamespaceService added in v0.5.0

type NamespaceService interface {
	GetByID(ctx context.Context, id uuid.UUID) (*namespace.Namespace, error)
	GetByName(ctx context.Context, name string) (*namespace.Namespace, error)
}

type StatsDClient added in v0.2.3

type StatsDClient interface {
	Histogram(name string, value float64) *statsd.Metric
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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