Documentation ¶
Index ¶
- Constants
- func ExtractAuthMetadata(ctx context.Context, mdKey, schema string) (string, error)
- func GracefulStop(grpcServer *grpc.Server, hook func(os.Signal)) chan struct{}
- func LogrusKeySortingFunc(keys []string)
- func StreamServerAuthHandler(authProvider AuthProvider) grpc.StreamServerInterceptor
- func StreamServerContextInjector(injector ContextInjector) grpc.StreamServerInterceptor
- func StreamServerErrorDeterminer(determiner ErrorDeterminer) grpc.StreamServerInterceptor
- func StreamServerLogger(logger *logrus.Logger, determiner LogLevelDeterminer, ...) grpc.StreamServerInterceptor
- func StreamServerRecoveryHandler(recoveryHandler RecoveryHandler) grpc.StreamServerInterceptor
- func StreamServerSelector(interceptor grpc.StreamServerInterceptor, matcher SelectorMatcher) grpc.StreamServerInterceptor
- func UnaryServerAuthHandler(authProvider AuthProvider) grpc.UnaryServerInterceptor
- func UnaryServerContextInjector(injector ContextInjector) grpc.UnaryServerInterceptor
- func UnaryServerErrorDeterminer(determiner ErrorDeterminer) grpc.UnaryServerInterceptor
- func UnaryServerLogger(logger *logrus.Logger, determiner LogLevelDeterminer) grpc.UnaryServerInterceptor
- func UnaryServerRecoveryHandler(recoveryHandler RecoveryHandler) grpc.UnaryServerInterceptor
- func UnaryServerSelector(interceptor grpc.UnaryServerInterceptor, matcher SelectorMatcher) grpc.UnaryServerInterceptor
- type AuthProvider
- type AuthProviderFunc
- type CallContext
- type CallType
- type ContextInjector
- type ErrorDeterminer
- type LogLevelDeterminer
- type MultiAuthProvider
- type PanicWrapper
- type RecoveryHandler
- type SelectorMatcher
Constants ¶
View Source
const ( CallTypeUnary = CallType(iota) CallTypeClientStream CallTypeServerStream CallTypeBidiStream )
Variables ¶
This section is empty.
Functions ¶
func ExtractAuthMetadata ¶ added in v0.0.6
func LogrusKeySortingFunc ¶
func LogrusKeySortingFunc(keys []string)
func StreamServerAuthHandler ¶ added in v0.0.2
func StreamServerAuthHandler(authProvider AuthProvider) grpc.StreamServerInterceptor
func StreamServerContextInjector ¶ added in v0.0.2
func StreamServerContextInjector(injector ContextInjector) grpc.StreamServerInterceptor
func StreamServerErrorDeterminer ¶ added in v0.0.3
func StreamServerErrorDeterminer(determiner ErrorDeterminer) grpc.StreamServerInterceptor
func StreamServerLogger ¶ added in v0.0.2
func StreamServerLogger(logger *logrus.Logger, determiner LogLevelDeterminer, payloadLevel logrus.Level) grpc.StreamServerInterceptor
func StreamServerRecoveryHandler ¶ added in v0.0.2
func StreamServerRecoveryHandler(recoveryHandler RecoveryHandler) grpc.StreamServerInterceptor
func StreamServerSelector ¶ added in v0.0.2
func StreamServerSelector(interceptor grpc.StreamServerInterceptor, matcher SelectorMatcher) grpc.StreamServerInterceptor
func UnaryServerAuthHandler ¶ added in v0.0.2
func UnaryServerAuthHandler(authProvider AuthProvider) grpc.UnaryServerInterceptor
func UnaryServerContextInjector ¶ added in v0.0.2
func UnaryServerContextInjector(injector ContextInjector) grpc.UnaryServerInterceptor
func UnaryServerErrorDeterminer ¶ added in v0.0.3
func UnaryServerErrorDeterminer(determiner ErrorDeterminer) grpc.UnaryServerInterceptor
func UnaryServerLogger ¶ added in v0.0.2
func UnaryServerLogger(logger *logrus.Logger, determiner LogLevelDeterminer) grpc.UnaryServerInterceptor
func UnaryServerRecoveryHandler ¶ added in v0.0.2
func UnaryServerRecoveryHandler(recoveryHandler RecoveryHandler) grpc.UnaryServerInterceptor
func UnaryServerSelector ¶ added in v0.0.2
func UnaryServerSelector(interceptor grpc.UnaryServerInterceptor, matcher SelectorMatcher) grpc.UnaryServerInterceptor
Types ¶
type AuthProvider ¶ added in v0.0.5
type AuthProvider interface {
VerifyAuth(c *CallContext) (context.Context, error)
}
type AuthProviderFunc ¶ added in v0.0.7
type AuthProviderFunc func(c *CallContext) (context.Context, error)
func (AuthProviderFunc) VerifyAuth ¶ added in v0.0.7
func (f AuthProviderFunc) VerifyAuth(c *CallContext) (context.Context, error)
type CallContext ¶ added in v0.0.2
type CallContext struct { Server any FullMethod string CallType CallType // contains filtered or unexported fields }
func (*CallContext) Context ¶ added in v0.0.7
func (c *CallContext) Context() context.Context
type ContextInjector ¶
type ContextInjector func(c *CallContext) context.Context
type ErrorDeterminer ¶ added in v0.0.2
type ErrorDeterminer func(c *CallContext, err error) error
type LogLevelDeterminer ¶ added in v0.0.2
type LogLevelDeterminer func(c *CallContext, err error) logrus.Level
type MultiAuthProvider ¶ added in v0.0.7
type MultiAuthProvider struct { // Providers is a list of auth providers to be chained Providers []AuthProvider // AllowUnauthenticated allows the process to pass without authentication // if all providers fail. AllowUnauthenticated bool // EvaluateAll ensures that all providers in the chain are evaluated, // injecting combined contexts from all successful providers, even if one succeeds early. EvaluateAll bool // RequireAll requires all providers to succeed, otherwise it will return an error. RequireAll bool }
func (*MultiAuthProvider) VerifyAuth ¶ added in v0.0.7
func (p *MultiAuthProvider) VerifyAuth(c *CallContext) (context.Context, error)
type PanicWrapper ¶
func (PanicWrapper) Error ¶
func (p PanicWrapper) Error() string
type RecoveryHandler ¶ added in v0.0.2
type RecoveryHandler func(c *CallContext, p *PanicWrapper) error
type SelectorMatcher ¶ added in v0.0.2
type SelectorMatcher func(c *CallContext) bool
Click to show internal directories.
Click to hide internal directories.