grpcgotenancy

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package grpcgotenancy adapts GoTenancy tenant propagation to gRPC interceptors.

Index

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

func WithMetadataKey(key string) Option

WithMetadataKey overrides the incoming metadata key.

func WithTenantIDStrategy

func WithTenantIDStrategy(strategy types.TenantIDStrategy) Option

WithTenantIDStrategy overrides tenant ID parsing strategy.

Jump to

Keyboard shortcuts

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