Documentation ¶
Index ¶
- func AddFlags(flags *flag.FlagSet)
- func ExtractTenantHTTPHandler(tc *Manager, h http.Handler) http.Handler
- func GetTenant(ctx context.Context) string
- func NewClientStreamInterceptor(tc *Manager) grpc.StreamClientInterceptor
- func NewClientUnaryInterceptor(tc *Manager) grpc.UnaryClientInterceptor
- func NewGuardingStreamInterceptor(tc *Manager) grpc.StreamServerInterceptor
- func NewGuardingUnaryInterceptor(tc *Manager) grpc.UnaryServerInterceptor
- func WithTenant(ctx context.Context, tenant string) context.Context
- type Manager
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTenantHTTPHandler ¶
PropagationHandler returns a http.Handler containing the logic to extract the tenancy header of the http.Request and insert the tenant into request.Context for propagation. The token can be accessed via tenancy.GetTenant().
func NewClientStreamInterceptor ¶
func NewClientStreamInterceptor(tc *Manager) grpc.StreamClientInterceptor
NewClientStreamInterceptor injects tenant header into gRPC request metadata.
func NewClientUnaryInterceptor ¶
func NewClientUnaryInterceptor(tc *Manager) grpc.UnaryClientInterceptor
NewClientUnaryInterceptor injects tenant header into gRPC request metadata.
func NewGuardingStreamInterceptor ¶
func NewGuardingStreamInterceptor(tc *Manager) grpc.StreamServerInterceptor
NewGuardingStreamInterceptor blocks handling of streams whose tenancy header doesn't meet tenancy requirements. It also ensures the tenant is directly in the context, rather than context metadata.
func NewGuardingUnaryInterceptor ¶
func NewGuardingUnaryInterceptor(tc *Manager) grpc.UnaryServerInterceptor
NewGuardingUnaryInterceptor blocks handling of RPCs whose tenancy header doesn't meet tenancy requirements. It also ensures the tenant is directly in the context, rather than context metadata.
Types ¶
type Manager ¶
Manager can check tenant usage for multi-tenant Jaeger configurations
func NewManager ¶
NewManager creates a tenancy.Manager for given tenancy.Options.
func (*Manager) MetadataAnnotator ¶
MetadataAnnotator returns a function suitable for propagating tenancy via github.com/grpc-ecosystem/grpc-gateway/runtime.NewServeMux