serverMux

package
v2.25.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 23 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

type JsonMarshaler struct {
	*runtime.JSONPb
}

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

type JsonpbMarshaler struct {
	*runtime.JSONPb
}

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".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL