Documentation ¶
Index ¶
- func ErrorHandler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, ...)
- func New(opts ...runtime.ServeMuxOption) *runtime.ServeMux
- func NewRouter(queryCaseInsensitive map[string]string, authInterceptor pkgHttpJwt.Interceptor, ...) *router.Router
- func WriteError(w netHttp.ResponseWriter, err error)
- type ErrorResponseWrapperWriter
- type JsonMarshaler
- type JsonpbMarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func ErrorHandler(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)
ErrorHandler is a convenient HTTP error handler for grpc.
func New ¶
func New(opts ...runtime.ServeMuxOption) *runtime.ServeMux
New creates default server mux
func NewRouter ¶
func NewRouter(queryCaseInsensitive map[string]string, authInterceptor pkgHttpJwt.Interceptor, opts ...pkgHttp.LogOpt) *router.Router
NewRouter creates router with default middlewares
func WriteError ¶
func WriteError(w netHttp.ResponseWriter, err error)
WriteError encodes error as google.golang.org/genproto/googleapis/rpc/status
Types ¶
type ErrorResponseWrapperWriter ¶
type ErrorResponseWrapperWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func NewErrorResponseWrapperWriter ¶
func NewErrorResponseWrapperWriter(w http.ResponseWriter, code int) *ErrorResponseWrapperWriter
func (*ErrorResponseWrapperWriter) Flush ¶
func (w *ErrorResponseWrapperWriter) Flush()
func (*ErrorResponseWrapperWriter) WriteHeader ¶
func (w *ErrorResponseWrapperWriter) WriteHeader(_ int)
type JsonMarshaler ¶
func NewJsonMarshaler ¶
func NewJsonMarshaler() *JsonMarshaler
NewJsonMarshaler is a marshaler tries to encode internal data to jsons and cbors string as json object
func (*JsonMarshaler) ContentType ¶
func (*JsonMarshaler) ContentType(_ interface{}) string
ContentType always returns "application/json".
func (*JsonMarshaler) Marshal ¶
func (j *JsonMarshaler) Marshal(v interface{}) ([]byte, error)
Marshal marshals "v" into JSON.
type JsonpbMarshaler ¶
func NewJsonpbMarshaler ¶
func NewJsonpbMarshaler() *JsonpbMarshaler
NewJsonpbMarshaler is a proto marshaler that uses jsonpb. proto <=> jsonpb
func (*JsonpbMarshaler) ContentType ¶
func (*JsonpbMarshaler) ContentType(_ interface{}) string
ContentType always returns "application/json".
Click to show internal directories.
Click to hide internal directories.