package
1.16.0
Repository: https://github.com/grpc-ecosystem/grpc-gateway.git
Documentation: pkg.go.dev

# Functions

AnnotateContext adds context information such as metadata from the request.
AnnotateIncomingContext adds context information such as metadata from the request.
AssumeColonVerbOpt indicates whether a path suffix after a final colon may only be interpreted as a verb.
Bool converts the given string representation of a boolean value into bool.
BoolP parses the given string representation of a boolean value, and returns a pointer to a bool whose value is same as the parsed value.
BoolSlice converts 'val' where individual booleans are separated by 'sep' into a bool slice.
BoolValue well-known type support as wrapper around bool type.
Bytes converts the given string representation of a byte sequence into a slice of bytes A bytes sequence is encoded in URL-safe base64 without padding.
BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe base64 without padding, are separated by 'sep' into a slice of bytes slices slice.
BytesValue well-known type support as wrapper around bytes[] type.
DefaultHeaderMatcher is used to pass http request headers to/from gRPC context.
DefaultHTTPError is the default implementation of HTTPError.
DefaultHTTPProtoErrorHandler is an implementation of HTTPError.
DefaultHTTPStreamErrorHandler converts the given err into a *StreamError via default logic.
DefaultOtherErrorHandler is the default implementation of OtherErrorHandler.
DisallowUnknownFields enables option in decoder (unmarshaller) to return an error when it finds an unknown field.
DoubleValue well-known type support as wrapper around float64 type.
Duration converts the given string into a timestamp.Duration.
Enum converts the given string into an int32 that should be type casted into the correct enum proto type.
EnumSlice converts 'val' where individual enums are separated by 'sep' into a int32 slice.
FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body.
Float32 converts the given string representation of a floating point number into float32.
Float32P parses the given string representation of a floating point number, and returns a pointer to a float32 whose value is same as the parsed number.
Float32Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float32 slice.
Float64 converts the given string representation into representation of a floating point number into float64.
Float64P parses the given string representation of a floating point number, and returns a pointer to a float64 whose value is same as the parsed number.
Float64Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float64 slice.
FloatValue well-known type support as wrapper around float32 type.
ForwardResponseMessage forwards the message "resp" from gRPC server to REST client.
ForwardResponseStream forwards the stream from gRPC server to REST client.
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status.
Int32 converts the given string representation of an integer into int32.
Int32P parses the given string representation of an integer and returns a pointer to a int32 whose value is same as the parsed integer.
Int32Slice converts 'val' where individual integers are separated by 'sep' into a int32 slice.
Int32Value well-known type support as wrapper around int32 type.
Int64 converts the given string representation of an integer into int64.
Int64P parses the given string representation of an integer and returns a pointer to a int64 whose value is same as the parsed integer.
Int64Slice converts 'val' where individual integers are separated by 'sep' into a int64 slice.
Int64Value well-known type support as wrapper around int64 type.
MarshalerForRequest returns the inbound/outbound marshalers for this request.
MustPattern is a helper function which makes it easier to call NewPattern in variable initialization.
MuxOrGlobalHTTPError uses the mux-configured error handler, falling back to GlobalErrorHandler.
NewPattern returns a new Pattern from the given definition values.
NewServeMux returns a new ServeMux whose internal mapping is empty.
NewServerMetadataContext creates a new context with ServerMetadata.
PopulateFieldFromPath sets a value in a nested Protobuf structure.
PopulateQueryParameters parses query parameters into "msg" using current query parser.
ServerMetadataFromContext returns the ServerMetadata in ctx.
SetHTTPBodyMarshaler overwrite the default marshaler with the HTTPBodyMarshaler.
SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters.
String just returns the given string.
StringP returns a pointer to a string whose pointee is same as the given string value.
StringSlice converts 'val' where individual strings are separated by 'sep' into a string slice.
StringValue well-known type support as wrapper around string type.
Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp.
Uint32 converts the given string representation of an integer into uint32.
Uint32P parses the given string representation of an integer and returns a pointer to a uint32 whose value is same as the parsed integer.
Uint32Slice converts 'val' where individual integers are separated by 'sep' into a uint32 slice.
UInt32Value well-known type support as wrapper around uint32 type.
Uint64 converts the given string representation of an integer into uint64.
Uint64P parses the given string representation of an integer and returns a pointer to a uint64 whose value is same as the parsed integer.
Uint64Slice converts 'val' where individual integers are separated by 'sep' into a uint64 slice.
UInt64Value well-known type support as wrapper around uint64 type.
WithDisablePathLengthFallback returns a ServeMuxOption for disable path length fallback.
WithForwardResponseOption returns a ServeMuxOption representing the forwardResponseOption.
WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway.
WithLastMatchWins returns a ServeMuxOption that will enable "last match wins" behavior, where if multiple path patterns match a request path, the last one defined in the .proto file will be used.
WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound Marshalers to a MIME type in mux.
WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context.
WithOutgoingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway.
WithProtoErrorHandler returns a ServeMuxOption for configuring a custom error handler.
WithStreamErrorHandler returns a ServeMuxOption that will use the given custom stream error handler, which allows for customizing the error trailer for server-streaming calls.

# Constants

MetadataHeaderPrefix is the http prefix that represents custom metadata parameters to or from a gRPC call.
MetadataPrefix is prepended to permanent HTTP header keys (as specified by the IANA) when added to the gRPC context.
MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to HTTP headers in a response handled by grpc-gateway.
MIMEWildcard is the fallback MIME type used for requests which do not match a registered MIME type.

# Variables

DefaultContextTimeout is used for gRPC call context.WithTimeout whenever a Grpc-Timeout inbound header isn't present.
ErrInvalidPattern indicates that the given definition of Pattern is not valid.
ErrNotMatch indicates that the given HTTP request path does not match to the pattern.
ErrUnknownURI is the error supplied to a custom ProtoErrorHandlerFunc when a request is received with a URI path that does not match any registered service method.
GlobalHTTPErrorHandler is the HTTPError handler for all ServeMux instances not using the WithProtoErrorHandler serve option.
HTTPError replies to the request with an error.
OtherErrorHandler handles gateway errors from parsing and routing client requests for all ServeMux instances not using the WithProtoErrorHandler serve option.

# Structs

DecoderWrapper is a wrapper around a *json.Decoder that adds support for protos to the Decode method.
HTTPBodyMarshaler is a Marshaler which supports marshaling of a google.api.HttpBody message as the full response body if it is the actual message used as the response.
JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON with the standard "encoding/json" package of Golang.
Pattern is a template pattern of http request paths defined in github.com/googleapis/googleapis/google/api/http.proto.
ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes.
ServeMux is a request multiplexer for grpc-gateway.
ServerMetadata consists of metadata sent from gRPC server.
ServerTransportStream implements grpc.ServerTransportStream.

# Interfaces

Decoder decodes a byte sequence.
Delimited defines the streaming delimiter.
Encoder encodes gRPC payloads / fields into byte sequence.
Marshaler defines a conversion between byte sequence and gRPC payloads / fields.
QueryParameterParser defines interface for all query parameter parsers.

# Type aliases

DecoderFunc adapts an decoder function into Decoder.
EncoderFunc adapts an encoder function into Encoder.
A HandlerFunc handles a specific pair of path pattern and HTTP method.
HeaderMatcherFunc checks whether a header key should be forwarded to/from gRPC context.
JSONPb is a Marshaler which marshals/unmarshals into/from JSON with the "github.com/golang/protobuf/jsonpb".
PatternOpt is an option for creating Patterns.
ProtoErrorHandlerFunc handles the error as a gRPC error generated via status package and replies to the request.
ServeMuxOption is an option that can be given to a ServeMux on construction.
StreamError is the payload for the final message in a server stream in the event that the server returns an error after a response message has already been sent.
StreamErrorHandlerFunc accepts an error as a gRPC error generated via status package and translates it into a a proto struct used to represent error at the end of a stream.