interceptor

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// XRequestIDKey is a key for getting request id.
	XRequestIDKey = "X-Request-ID"
)

Variables

This section is empty.

Functions

func AuthenticationInterceptor

func AuthenticationInterceptor() grpc.UnaryServerInterceptor

AuthenticationInterceptor is a interceptor of authentication.

func PayloadUnaryClientInterceptor

func PayloadUnaryClientInterceptor(entry *logrus.Entry, decider grpc_logging.ClientPayloadLoggingDecider, startTimeFunc func() time.Time, durationFunc func(startTime time.Time) time.Duration) grpc.UnaryClientInterceptor

PayloadUnaryClientInterceptor returns a new unary client interceptor that logs the paylods of requests and responses.

func RequestIDInterceptor

func RequestIDInterceptor() grpc.UnaryServerInterceptor

RequestIDInterceptor is a interceptor of access control list.

Types

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context, req interface{}) (context.Context, error)
}

Authenticator provides Authenticate method. Each service should implement this interface, otherwise, all requests will be rejected with authentication error.

Jump to

Keyboard shortcuts

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