Documentation
¶
Index ¶
- Constants
- func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, ...)
- type DialOption
- type ErrorHandlerFunc
- type HandleChainFunc
- type HeaderMatcherFunc
- type Logger
- type Marshaler
- type QueryParameterParser
- type RESTProxyServer
- type RESTProxyServerOption
- func SetQueryParameterParser(p QueryParameterParser) RESTProxyServerOption
- func WithAppendedDialOption(d DialOption) RESTProxyServerOption
- func WithErrorHandler(o ErrorHandlerFunc) RESTProxyServerOption
- func WithGRPCAddress(a string) RESTProxyServerOption
- func WithHTTPHandler(h HandleChainFunc) RESTProxyServerOption
- func WithHandlePath(verb string, urlPath string, ...) RESTProxyServerOption
- func WithIncomingHeaderMatcher(o HeaderMatcherFunc) RESTProxyServerOption
- func WithMarshaler(mime string, m Marshaler) RESTProxyServerOption
- func WithOutgoingHeaderMatcher(o HeaderMatcherFunc) RESTProxyServerOption
- func WithPrependedDialOption(d DialOption) RESTProxyServerOption
- func WithRegisterHandler(r RegisterRESTProxyServer) RESTProxyServerOption
- type RegisterRESTProxyServer
- type ServeMux
Constants ¶
const (
MIMEWildcard = runtime.MIMEWildcard
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DialOption ¶
type DialOption = grpc.DialOption
type ErrorHandlerFunc ¶ added in v0.8.0
type ErrorHandlerFunc = runtime.ErrorHandlerFunc
type HandleChainFunc ¶ added in v0.8.0
type HandleChainFunc = httpserver.HandleChainFunc
type HeaderMatcherFunc ¶ added in v0.8.0
type HeaderMatcherFunc = runtime.HeaderMatcherFunc
type QueryParameterParser ¶ added in v0.7.1
type QueryParameterParser = runtime.QueryParameterParser
type RESTProxyServer ¶
type RESTProxyServer struct {
// contains filtered or unexported fields
}
RESTProxyServer represents the grpc-gateway rest openapiv2 serve endpoint.
func New ¶
func New(log Logger, name string, port string, opts ...RESTProxyServerOption) RESTProxyServer
New creates a new RESTProxyServer that is bound to a specific GRPC Gateway API. This object complies with the standard Listener interface and can be managed by the startup.Listeners object.
func (*RESTProxyServer) Listen ¶
func (g *RESTProxyServer) Listen() error
func (*RESTProxyServer) String ¶
func (g *RESTProxyServer) String() string
type RESTProxyServerOption ¶
type RESTProxyServerOption func(*RESTProxyServer)
func SetQueryParameterParser ¶ added in v0.7.1
func SetQueryParameterParser(p QueryParameterParser) RESTProxyServerOption
SetQueryParameterParser adds an intercepror that matches header values.
func WithAppendedDialOption ¶ added in v0.7.1
func WithAppendedDialOption(d DialOption) RESTProxyServerOption
WithAppendedDialOption appends a grpc dial option.
func WithErrorHandler ¶ added in v0.7.1
func WithErrorHandler(o ErrorHandlerFunc) RESTProxyServerOption
WithErrorHandler adds error handling in special cases - e.g on 402 or 429.
func WithGRPCAddress ¶ added in v0.7.1
func WithGRPCAddress(a string) RESTProxyServerOption
WithGRPCAddress - overides the defaultGRPSAddress ('localhost:<port>')
func WithHTTPHandler ¶ added in v0.8.0
func WithHTTPHandler(h HandleChainFunc) RESTProxyServerOption
WithHTTPHandler adds a handler on the http endpoint.
func WithHandlePath ¶ added in v0.7.1
func WithHandlePath(verb string, urlPath string, f func(http.ResponseWriter, *http.Request, map[string]string)) RESTProxyServerOption
WithHandlePath add REST file path handler.
func WithIncomingHeaderMatcher ¶ added in v0.7.1
func WithIncomingHeaderMatcher(o HeaderMatcherFunc) RESTProxyServerOption
WithOutgoingHeaderMatcher matches header values on oupput. WithIncomingHeaderMatcher adds an intercepror that matches header values.
func WithMarshaler ¶
func WithMarshaler(mime string, m Marshaler) RESTProxyServerOption
WithMarshaler specifies on an optional marshaler.
func WithOutgoingHeaderMatcher ¶ added in v0.7.1
func WithOutgoingHeaderMatcher(o HeaderMatcherFunc) RESTProxyServerOption
WithOutgoingHeaderMatcher matches header values on oupput.
func WithPrependedDialOption ¶ added in v0.7.1
func WithPrependedDialOption(d DialOption) RESTProxyServerOption
WithPrependedDialOption prepends a grpc dial option.
func WithRegisterHandler ¶ added in v0.8.0
func WithRegisterHandler(r RegisterRESTProxyServer) RESTProxyServerOption
WithRegisterHandler adds another grpc-gateway handler