Documentation ¶
Index ¶
- func ErrorHandler(logger log.Logger) grpc.Middleware
- func Log(logger log.Logger, logBody bool) grpc.Middleware
- func Metrics(storage MetricStorage) grpc.Middleware
- func Recovery() grpc.Middleware
- func RequestId() grpc.Middleware
- type Caller
- type GrpcError
- type JsonRequestExtractor
- type JsonResponseMapper
- type MetricStorage
- type ParamBuilder
- type ParamMapper
- type RequestBodyExtractor
- type ResponseBodyMapper
- type Validator
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func ErrorHandler(logger log.Logger) grpc.Middleware
func Metrics ¶
func Metrics(storage MetricStorage) grpc.Middleware
func Recovery ¶
func Recovery() grpc.Middleware
func RequestId ¶
func RequestId() grpc.Middleware
Types ¶
type Caller ¶
type Caller struct {
// contains filtered or unexported fields
}
func NewCaller ¶
func NewCaller( f any, bodyExtractor RequestBodyExtractor, bodyMapper ResponseBodyMapper, paramMappers map[string]ParamMapper, ) (*Caller, error)
type JsonRequestExtractor ¶
type JsonRequestExtractor struct {
Validator Validator
}
type JsonResponseMapper ¶
type JsonResponseMapper struct { }
type MetricStorage ¶
type ParamMapper ¶
type ParamMapper struct { Type string Builder ParamBuilder }
func AuthDataParam ¶
func AuthDataParam() ParamMapper
func ContextParam ¶
func ContextParam() ParamMapper
type RequestBodyExtractor ¶
type ResponseBodyMapper ¶
type Wrapper ¶
type Wrapper struct { ParamMappers map[string]ParamMapper BodyExtractor RequestBodyExtractor BodyMapper ResponseBodyMapper Middlewares []grpc.Middleware }
func DefaultWrapper ¶
func DefaultWrapper(logger log.Logger, restMiddlewares ...grpc.Middleware) Wrapper
func NewWrapper ¶
func NewWrapper( paramMappers []ParamMapper, bodyExtractor RequestBodyExtractor, bodyMapper ResponseBodyMapper, ) Wrapper
func (Wrapper) WithMiddlewares ¶
func (m Wrapper) WithMiddlewares(middlewares ...grpc.Middleware) Wrapper
Click to show internal directories.
Click to hide internal directories.