Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultJSONMarshaler = &runtime.JSONPb{ UnmarshalOptions: protojson.UnmarshalOptions{ DiscardUnknown: true, }, } DefaultServeMuxOptions = func(customHeaders ...string) []runtime.ServeMuxOption { return []runtime.ServeMuxOption{ runtime.WithMarshalerOption(DefaultJSONMarshaler.ContentType(nil), DefaultJSONMarshaler), runtime.WithMarshalerOption(mimeWildcard, DefaultJSONMarshaler), runtime.WithMarshalerOption(runtime.MIMEWildcard, DefaultJSONMarshaler), runtime.WithIncomingHeaderMatcher(DefaultHeaderMatcher(customHeaders...)), runtime.WithOutgoingHeaderMatcher(runtime.DefaultHeaderMatcher), } } DefaultHeaderMatcher = func(customHeaders ...string) runtime.HeaderMatcherFunc { return func(header string) (string, bool) { for _, customHeader := range customHeaders { if strings.HasPrefix(strings.ToLower(header), customHeader) { return header, true } } return runtime.DefaultHeaderMatcher(header) } } )
Functions ¶
func CreateServer ¶
Types ¶
type Gateway ¶
type Gateway interface { RegisterGateway() GatewayFunc GatewayPathPrefix() string }
type GatewayFunc ¶
type GatewayHandler ¶
type GatewayHandler struct {
// contains filtered or unexported fields
}
func CreateGatewayHandler ¶
func CreateGatewayHandler(config grpc_util.Config) *GatewayHandler
func (*GatewayHandler) RegisterGateway ¶
func (g *GatewayHandler) RegisterGateway(ctx context.Context, gateway Gateway)
RegisterGateway registers a handler (Gateway interface) on defined port Gateway interface may be extended with optional implementation of interfaces (gatewayCustomServeMuxOptions, ...)
func (*GatewayHandler) RegisterHandler ¶
func (g *GatewayHandler) RegisterHandler(prefix string, handler http.Handler)
func (*GatewayHandler) Serve ¶
func (g *GatewayHandler) Serve(ctx context.Context)
type ValidationFunction ¶
Click to show internal directories.
Click to hide internal directories.