# Functions
Code returns an instance of gRPC code by its string name.
CodeName returns stringname of gRPC code, function handles as standard codes from "google.golang.org/grpc/codes" as well as custom ones defined in this package.
FieldSelection extracts op.FieldSelection from gRPC metadata.
Filtering extracts filter parameters from incoming gRPC context.
Header returns first value for a given key if it exists in gRPC metadata from incoming or outcoming context, otherwise returns (nil, false)
Calls HeaderN(ctx, key, 1)
Provided key is converted to lowercase (see grpc/metadata.New).
HeaderN returns first n values for a given key if it exists in gRPC metadata from incoming or outcoming context, otherwise returns (nil, false)
If n < 0 all values for a given key will be returned If n > 0 at least n values will be returned, or (nil, false) If n == 0 result is (nil, false)
Provided key is converted to lowercase (see grpc/metadata.New).
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status.
MetadataAnnotator is a function for passing metadata to a gRPC context It must be mainly used as ServeMuxOption for gRPC Gateway 'ServeMux' See: 'WithMetadata' option.
NewForwardResponseMessage returns ForwardResponseMessageFunc.
NewForwardResponseStream returns ForwardResponseStreamFunc.
NewGateway creates a gRPC REST gateway with HTTP handlers that have been generated by the gRPC gateway protoc plugin.
NewPaginationContext return the new `context.Context` that caries `*query.Pagination` instance.
NewProtoMessageErrorHandler returns runtime.ProtoErrorHandlerFunc.
NewProtoStreamErrorHandler returns ProtoStreamErrorHandlerFunc.
Pagination extracts pagination parameters from incoming gRPC context.
PrefixOutgoingHeaderMatcher prefixes outgoing gRPC metadata with runtime.MetadataHeaderPrefix ("Grpc-Metadata-").
SetCreated is a shortcut for SetStatus(ctx, status.New(Created, msg)).
SetDeleted is a shortcut for SetStatus(ctx, status.New(Deleted, msg)).
SetFieldSelection sets op.FieldSelection to gRPC metadata.
SetPagination sets page info to outgoing gRPC context.
SetRunning is a shortcut for SetStatus(ctx, status.New(LongRunning, url)).
SetStatus sets gRPC status as gRPC metadata Status.Code will be set with metadata key `grpcgateway-status-code` and with value as string name of the code.
SetUpdated is a shortcut for SetStatus(ctx, status.New(Updated, msg)).
Sorting extracts sort parameters from incoming gRPC context.
Status returns REST representation of gRPC status.
UnaryServerInterceptor returns grpc.UnaryServerInterceptor that should be used as a middleware if an user's testRequest message defines any of collection operators.
WithDialOptions assigns a list of gRPC dial options to the REST gateway.
WithEndpointRegistration takes a group of HTTP handlers that have been generated by the gRPC gateway protoc plugin and registers them to the REST gateway with some prefix (e.g.
WithMux will use the given http.ServeMux to register the gateway endpoints.
WithServerAddress determines what address the gateway will connect to.
# Constants
10000 is an offset from standard codes.
DefaultServerAddress is the standard gRPC server address that a REST gateway will connect to.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ForwardResponseMessage is default implementation of ForwardResponseMessageFunc.
ForwardResponseStream is default implementation of ForwardResponseStreamFunc.
ProtoMessageErrorHandler uses PrefixOutgoingHeaderMatcher.
ProtoStreamErrorHandler uses PrefixOutgoingHeaderMatcher.
# Structs
ProtoErrorHandler implements runtime.ProtoErrorHandlerFunc in method MessageHandler and ProtoStreamErrorHandlerFunc in method StreamHandler in accordance with REST API Syntax Specification.
ResponseForwarder implements ForwardResponseMessageFunc in method ForwardMessage and ForwardResponseStreamFunc in method ForwardStream in accordance with REST API Syntax Specification.
RestError represents an error in accordance with REST API Syntax Specification.
RestStatus represents a response status in accordance with REST API Syntax.
# Type aliases
No description provided by the author
No description provided by the author
Option is a functional option that modifies the REST gateway on initialization.
ProtoStreamErrorHandlerFunc handles the error as a gRPC error generated via status package and replies to the testRequest.