Documentation
¶
Overview ¶
Package grpcgotenancy adapts GoTenancy tenant propagation to gRPC interceptors.
Index ¶
- func HostStreamServerInterceptor() grpc.StreamServerInterceptor
- func HostUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func TenantStatusStreamServerInterceptor() grpc.StreamServerInterceptor
- func TenantStatusUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func TenantStreamServerInterceptor(store store.Store, opts ...Option) grpc.StreamServerInterceptor
- func TenantUnaryServerInterceptor(store store.Store, opts ...Option) grpc.UnaryServerInterceptor
- type Config
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostStreamServerInterceptor ¶
func HostStreamServerInterceptor() grpc.StreamServerInterceptor
HostStreamServerInterceptor allows only explicit host context for streaming RPCs.
func HostUnaryServerInterceptor ¶
func HostUnaryServerInterceptor() grpc.UnaryServerInterceptor
HostUnaryServerInterceptor allows only explicit host context for unary RPCs.
func TenantStatusStreamServerInterceptor ¶
func TenantStatusStreamServerInterceptor() grpc.StreamServerInterceptor
TenantStatusStreamServerInterceptor allows only active tenants for streaming RPCs.
func TenantStatusUnaryServerInterceptor ¶
func TenantStatusUnaryServerInterceptor() grpc.UnaryServerInterceptor
TenantStatusUnaryServerInterceptor allows only active tenants for unary RPCs.
func TenantStreamServerInterceptor ¶
func TenantStreamServerInterceptor(store store.Store, opts ...Option) grpc.StreamServerInterceptor
TenantStreamServerInterceptor resolves tenant metadata for streaming RPCs.
func TenantUnaryServerInterceptor ¶
func TenantUnaryServerInterceptor(store store.Store, opts ...Option) grpc.UnaryServerInterceptor
TenantUnaryServerInterceptor resolves tenant metadata for unary RPCs.
Types ¶
type Config ¶
type Config struct {
MetadataKey string
Strategy types.TenantIDStrategy
}
Config controls gRPC tenant metadata extraction.
type Option ¶
type Option func(*Config)
Option configures gRPC interceptors.
func WithMetadataKey ¶
WithMetadataKey overrides the incoming metadata key.
func WithTenantIDStrategy ¶
func WithTenantIDStrategy(strategy types.TenantIDStrategy) Option
WithTenantIDStrategy overrides tenant ID parsing strategy.