Documentation ¶
Index ¶
Constants ¶
View Source
const RequestIDKey ctxKeyRequestID = 0
RequestIDKey is the key that holds th unique request ID in a request context.
Variables ¶
This section is empty.
Functions ¶
func AddLogger ¶
func AddLogger(logger *zap.Logger) alice.Constructor
AddLogger logs request/response pair
func AddRequestID ¶
func AddRequestID() alice.Constructor
RequestID is a middleware that injects a request ID into the context of each request. A request ID is a string of the form "host.example.com/random-0001", where "random" is a base62 random string that uniquely identifies this go process, and where the last number is an atomically incremented request counter.
Types ¶
type FuncRestService ¶
FuncServerOption wraps a function that modifies serverOptions into an implementation of the ServerOption interface.
func NewFuncRestService ¶
func NewFuncRestService(f func(context.Context, *runtime.ServeMux, string, ...grpc.DialOption)) FuncRestService
func (FuncRestService) RegisterService ¶
func (f FuncRestService) RegisterService(ctx context.Context, r *runtime.ServeMux, addr string, opts ...grpc.DialOption)
type RestService ¶
type RestService interface {
RegisterService(context.Context, *runtime.ServeMux, string, ...grpc.DialOption)
}
A ServerOption sets options such as credentials, codec and keepalive parameters, etc.
Click to show internal directories.
Click to hide internal directories.