Versions in this module Expand all Collapse all v0 v0.0.1 Aug 31, 2024 Changes in this version + const MIMEWildcard + const MetadataHeaderPrefix + const MetadataPrefix + const MetadataTrailerPrefix + var DefaultContextTimeout = 0 * time.Second + var ErrInvalidPattern = errors.New("invalid pattern") + var ErrNotMatch = errors.New("not match to the path pattern") + func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, ...) (context.Context, error) + func AnnotateIncomingContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcMethodName string, ...) (context.Context, error) + func Bool(val string) (bool, error) + func BoolP(val string) (*bool, error) + func BoolSlice(val, sep string) ([]bool, error) + func BoolValue(val string) (*wrapperspb.BoolValue, error) + func Bytes(val string) ([]byte, error) + func BytesSlice(val, sep string) ([][]byte, error) + func BytesValue(val string) (*wrapperspb.BytesValue, error) + func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, ...) + func DefaultHeaderMatcher(key string) (string, bool) + func DefaultRoutingErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, ...) + func DefaultStreamErrorHandler(_ context.Context, err error) *status.Status + func DoubleValue(val string) (*wrapperspb.DoubleValue, error) + func Duration(val string) (*durationpb.Duration, error) + func Enum(val string, enumValMap map[string]int32) (int32, error) + func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error) + func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.FieldMask, error) + func Float32(val string) (float32, error) + func Float32P(val string) (*float32, error) + func Float32Slice(val, sep string) ([]float32, error) + func Float64(val string) (float64, error) + func Float64P(val string) (*float64, error) + func Float64Slice(val, sep string) ([]float64, error) + func FloatValue(val string) (*wrapperspb.FloatValue, error) + func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, ...) + func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, ...) + func HTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, ...) + func HTTPPathPattern(ctx context.Context) (string, bool) + func HTTPStatusFromCode(code codes.Code) int + func Int32(val string) (int32, error) + func Int32P(val string) (*int32, error) + func Int32Slice(val, sep string) ([]int32, error) + func Int32Value(val string) (*wrapperspb.Int32Value, error) + func Int64(val string) (int64, error) + func Int64P(val string) (*int64, error) + func Int64Slice(val, sep string) ([]int64, error) + func Int64Value(val string) (*wrapperspb.Int64Value, error) + func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) + func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context + func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value string) error + func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error + func RPCMethod(ctx context.Context) (string, bool) + func String(val string) (string, error) + func StringP(val string) (*string, error) + func StringSlice(val, sep string) ([]string, error) + func StringValue(val string) (*wrapperspb.StringValue, error) + func Timestamp(val string) (*timestamppb.Timestamp, error) + func UInt32Value(val string) (*wrapperspb.UInt32Value, error) + func UInt64Value(val string) (*wrapperspb.UInt64Value, error) + func Uint32(val string) (uint32, error) + func Uint32P(val string) (*uint32, error) + func Uint32Slice(val, sep string) ([]uint32, error) + func Uint64(val string) (uint64, error) + func Uint64P(val string) (*uint64, error) + func Uint64Slice(val, sep string) ([]uint64, error) + type AnnotateContextOption func(ctx context.Context) context.Context + func WithHTTPPathPattern(pattern string) AnnotateContextOption + type Decoder interface + Decode func(v interface{}) error + type DecoderFunc func(v interface{}) error + func (f DecoderFunc) Decode(v interface{}) error + type DecoderWrapper struct + func (d DecoderWrapper) Decode(v interface{}) error + type DefaultQueryParser struct + func (*DefaultQueryParser) Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error + type Delimited interface + Delimiter func() []byte + type Encoder interface + Encode func(v interface{}) error + type EncoderFunc func(v interface{}) error + func (f EncoderFunc) Encode(v interface{}) error + type ErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, ...) + type HTTPBodyMarshaler struct + func (h *HTTPBodyMarshaler) ContentType(v interface{}) string + func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) + type HTTPStatusError struct + Err error + HTTPStatus int + func (e *HTTPStatusError) Error() string + type HandlerFunc func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) + type HeaderMatcherFunc func(string) (string, bool) + type JSONBuiltin struct + func (*JSONBuiltin) ContentType(_ interface{}) string + func (j *JSONBuiltin) Delimiter() []byte + func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) + func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder + func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder + func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error + type JSONPb struct + func (*JSONPb) ContentType(_ interface{}) string + func (j *JSONPb) Delimiter() []byte + func (j *JSONPb) Marshal(v interface{}) ([]byte, error) + func (j *JSONPb) NewDecoder(r io.Reader) Decoder + func (j *JSONPb) NewEncoder(w io.Writer) Encoder + func (j *JSONPb) Unmarshal(data []byte, v interface{}) error + type MalformedSequenceError string + func (e MalformedSequenceError) Error() string + type Marshaler interface + ContentType func(v interface{}) string + Marshal func(v interface{}) ([]byte, error) + NewDecoder func(r io.Reader) Decoder + NewEncoder func(w io.Writer) Encoder + Unmarshal func(data []byte, v interface{}) error + type Pattern struct + func MustPattern(p Pattern, err error) Pattern + func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, error) + func (p Pattern) Match(components []string, verb string) (map[string]string, error) + func (p Pattern) MatchAndEscape(components []string, verb string, unescapingMode UnescapingMode) (map[string]string, error) + func (p Pattern) String() string + func (p Pattern) Verb() string + type ProtoMarshaller struct + func (*ProtoMarshaller) ContentType(_ interface{}) string + func (*ProtoMarshaller) Marshal(value interface{}) ([]byte, error) + func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error + func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder + func (marshaller *ProtoMarshaller) NewEncoder(writer io.Writer) Encoder + type QueryParameterParser interface + Parse func(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error + type RoutingErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, int) + type ServeMux struct + func NewServeMux(opts ...ServeMuxOption) *ServeMux + func (s *ServeMux) GetForwardResponseOptions() []func(context.Context, http.ResponseWriter, proto.Message) error + func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) + func (s *ServeMux) HandlePath(meth string, pathPattern string, h HandlerFunc) error + func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) + type ServeMuxOption func(*ServeMux) + func SetQueryParameterParser(queryParameterParser QueryParameterParser) ServeMuxOption + func WithDisablePathLengthFallback() ServeMuxOption + func WithErrorHandler(fn ErrorHandlerFunc) ServeMuxOption + func WithForwardResponseOption(...) ServeMuxOption + func WithHealthEndpointAt(healthCheckClient grpc_health_v1.HealthClient, endpointPath string) ServeMuxOption + func WithHealthzEndpoint(healthCheckClient grpc_health_v1.HealthClient) ServeMuxOption + func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption + func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption + func WithMetadata(annotator func(context.Context, *http.Request) metadata.MD) ServeMuxOption + func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption + func WithOutgoingTrailerMatcher(fn HeaderMatcherFunc) ServeMuxOption + func WithRoutingErrorHandler(fn RoutingErrorHandlerFunc) ServeMuxOption + func WithStreamErrorHandler(fn StreamErrorHandlerFunc) ServeMuxOption + func WithUnescapingMode(mode UnescapingMode) ServeMuxOption + type ServerMetadata struct + HeaderMD metadata.MD + TrailerMD metadata.MD + func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) + type ServerTransportStream struct + func (s *ServerTransportStream) Header() metadata.MD + func (s *ServerTransportStream) Method() string + func (s *ServerTransportStream) SendHeader(md metadata.MD) error + func (s *ServerTransportStream) SetHeader(md metadata.MD) error + func (s *ServerTransportStream) SetTrailer(md metadata.MD) error + func (s *ServerTransportStream) Trailer() metadata.MD + type StreamErrorHandlerFunc func(context.Context, error) *status.Status + type UnescapingMode int + const UnescapingModeAllCharacters + const UnescapingModeAllExceptReserved + const UnescapingModeAllExceptSlash + const UnescapingModeDefault + const UnescapingModeLegacy