Documentation ¶
Index ¶
- type BaseContextInterceptor
- func (bi *BaseContextInterceptor) StreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (retErr error)
- func (bi *BaseContextInterceptor) UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, retErr error)
- type LoggingInterceptor
- func (li *LoggingInterceptor) StreamAnnounce(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (retErr error)
- func (li *LoggingInterceptor) StreamSetup(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (retErr error)
- func (li *LoggingInterceptor) UnaryAnnounce(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, retErr error)
- func (li *LoggingInterceptor) UnarySetup(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, retErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseContextInterceptor ¶
type BaseContextInterceptor struct {
// contains filtered or unexported fields
}
func NewBaseContextInterceptor ¶
func NewBaseContextInterceptor(ctx context.Context) *BaseContextInterceptor
func (*BaseContextInterceptor) StreamServerInterceptor ¶
func (bi *BaseContextInterceptor) StreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (retErr error)
func (*BaseContextInterceptor) UnaryServerInterceptor ¶
func (bi *BaseContextInterceptor) UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, retErr error)
type LoggingInterceptor ¶
func NewLoggingInterceptor ¶
func NewLoggingInterceptor(ctx context.Context) *LoggingInterceptor
NewLoggingInterceptor creates a new interceptor that logs method start and end. Note that the provided context is only for warnings generated by this function. It is not the root logger; that is injected by the BaseContextInterceptor.
func (*LoggingInterceptor) StreamAnnounce ¶ added in v2.10.0
func (li *LoggingInterceptor) StreamAnnounce(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (retErr error)
StreamAnnounce is a grpc stream server interceptor that announces the beginning and end of the request. It should be after the auth middleware in the interceptor chain.
func (*LoggingInterceptor) StreamSetup ¶ added in v2.10.0
func (li *LoggingInterceptor) StreamSetup(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (retErr error)
StreamSetup is a grpc stream server interceptor that sets up the grpc request for logging. It should be near the top of the interceptor chain.
func (*LoggingInterceptor) UnaryAnnounce ¶ added in v2.10.0
func (li *LoggingInterceptor) UnaryAnnounce(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, retErr error)
UnaryAnnounce is a grpc unary server interceptor that announces the beginning and end of the request. It should be after the auth middleware in the interceptor chain.
func (*LoggingInterceptor) UnarySetup ¶ added in v2.10.0
func (li *LoggingInterceptor) UnarySetup(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, retErr error)
UnarySetup is a grpc unary server interceptor that sets up the grpc request for logging. It should be near the top of the interceptor chain.