Versions in this module Expand all Collapse all v0 v0.0.4 Jul 9, 2022 Changes in this version + const ClientKey + const InternalKeyPrefix + const TenantAutoSetKey + const TenantFilterKey + const TenantInfoKey + const TenantKey + const UserKey + var DefaultProviderSet = wire.NewSet(NewDefaultOption, NewInMemoryTokenManager, ...) + func ClientPropagation(client *conf.Client, opt *Option, tokenMgr TokenManager, logger log.Logger) middleware.Middleware + func FromTrustedContext(ctx context.Context) (bool, bool) + func NewDiscovery(services *conf.Services) (registry.Discovery, error) + func NewGrpcConn(clientName ClientName, serviceName string, services *conf.Services, ...) (grpcx.ClientConnInterface, func()) + func NewHttpClient(clientName ClientName, serviceName string, services *conf.Services, ...) (*http.Client, func()) + func NewTrustedContext(ctx context.Context, trust ...bool) context.Context + func ServerPropagation(opt *Option, validator TrustedContextValidator, logger log.Logger) middleware.Middleware + func UnaryClientInterceptor(ms []middleware.Middleware, timeout time.Duration, filters []selector.Filter) grpc.UnaryClientInterceptor + type ClientName string + type ClientPropagator struct + func NewClientPropagator(extractOnly bool, logger log.Logger) *ClientPropagator + func (u *ClientPropagator) Extract(ctx context.Context, headers Header) (context.Context, error) + func (u *ClientPropagator) Fields() []string + func (u *ClientPropagator) Inject(ctx context.Context, carrier Header) error + type ClientTrustedContextValidator struct + func (c *ClientTrustedContextValidator) Trusted(ctx context.Context) (bool, error) + type Header interface + Get func(key string) string + HasKey func(key string) bool + Set func(key, value string) + type HeaderCarrier map[string]string + func (h HeaderCarrier) Get(key string) string + func (h HeaderCarrier) HasKey(key string) bool + func (h HeaderCarrier) Set(key, value string) + type InMemoryTokenManager struct + func NewInMemoryTokenManager(tokenizer jwt.Tokenizer, logger log.Logger) *InMemoryTokenManager + func (i *InMemoryTokenManager) GetOrGenerateToken(ctx context.Context, client *conf.Client) (string, error) + type Option struct + BypassToken bool + Insecure bool + Propagators []Propagator + func NewDefaultOption(logger log.Logger) *Option + func NewOption(bypassToken bool, propagators ...Propagator) *Option + func (o *Option) WithInsecure() *Option + type Propagator interface + Extract func(ctx context.Context, carrier Header) (context.Context, error) + Fields func() []string + Inject func(ctx context.Context, carrier Header) error + type SaasPropagator struct + func NewSaasPropagator(logger log.Logger) *SaasPropagator + func (s *SaasPropagator) Extract(ctx context.Context, headers Header) (context.Context, error) + func (s *SaasPropagator) Fields() []string + func (s *SaasPropagator) Inject(ctx context.Context, headers Header) error + type TokenManager interface + GetOrGenerateToken func(ctx context.Context, client *conf.Client) (token string, err error) + type Transport struct + func (tr *Transport) Endpoint() string + func (tr *Transport) Kind() transport.Kind + func (tr *Transport) Operation() string + func (tr *Transport) ReplyHeader() transport.Header + func (tr *Transport) RequestHeader() transport.Header + func (tr *Transport) SelectFilters() []selector.Filter + type TrustedContextValidator interface + Trusted func(ctx context.Context) (bool, error) + func NewClientTrustedContextValidator() TrustedContextValidator + type UserPropagator struct + func NewUserPropagator(logger log.Logger) *UserPropagator + func (u *UserPropagator) Extract(ctx context.Context, headers Header) (context.Context, error) + func (u *UserPropagator) Fields() []string + func (u *UserPropagator) Inject(ctx context.Context, carrier Header) error