Documentation ¶
Index ¶
- func DefaultEncodeResponse(ctx context.Context, writer http.ResponseWriter, response any) error
- func DefaultErrorEncoder(ctx context.Context, err error, writer http.ResponseWriter)
- func NewResponse(success bool, code int, message string, data any) error
- type Client
- type ClientConfig
- type DecodeRequestFunc
- type EncodeResponseFunc
- type ErrorEncoder
- type Handler
- type RequestFunc
- type Response
- type Server
- type ServerConfig
- type ServerResponseFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEncodeResponse ¶
func DefaultErrorEncoder ¶
func DefaultErrorEncoder(ctx context.Context, err error, writer http.ResponseWriter)
Types ¶
type ClientConfig ¶
type DecodeRequestFunc ¶
type EncodeResponseFunc ¶
type ErrorEncoder ¶
type ErrorEncoder func(ctx context.Context, err error, w http.ResponseWriter)
type Handler ¶
type Handler struct { DecodeRequest DecodeRequestFunc EncodeResponse EncodeResponseFunc ErrorEncoder ErrorEncoder Endpoint endpoint.Endpoint }
func NewHandler ¶
func NewHandler(decode DecodeRequestFunc, endpoint endpoint.Endpoint) *Handler
NewHandler 实例化处理
type RequestFunc ¶ added in v1.0.2
type Response ¶
type Server ¶
type Server struct { Config ServerConfig Handler http.Handler Limiter *limiter.Limiter Nacos *nacos.Nacos // contains filtered or unexported fields }
func (*Server) After ¶ added in v1.0.2
func (s *Server) After(after ...ServerResponseFunc)
func (*Server) Before ¶ added in v1.0.2
func (s *Server) Before(before ...RequestFunc)
type ServerConfig ¶
type ServerResponseFunc ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.