Documentation ¶
Index ¶
- type EmptyGRPCGatewayOption
- type GRPCGateway
- func (o *GRPCGateway) ApplyOptions(options ...GRPCGatewayOption) *GRPCGateway
- func (g *GRPCGateway) ListenAndServe() error
- func (g *GRPCGateway) RegisterGRPCHandler(h func(srv *grpc.Server))
- func (g *GRPCGateway) RegisterHTTPHandler(ctx context.Context, ...) error
- func (g *GRPCGateway) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type GRPCGatewayOption
- func WithClientDialOptions(opts ...grpc.DialOption) GRPCGatewayOption
- func WithGatewayMuxOptions(opts ...runtime.ServeMuxOption) GRPCGatewayOption
- func WithHttpHandlerInterceptorInOutPacketOptions() GRPCGatewayOption
- func WithHttpHandlerInterceptorOptions(handlers ...http_.HandlerInterceptor) GRPCGatewayOption
- func WithHttpHandlerInterceptorTraceIDOptions() GRPCGatewayOption
- func WithHttpHandlerInterceptorsTimerOptions(enabledMetric bool) GRPCGatewayOption
- func WithHttpPostHandlerInterceptorOptions(handlers ...func(w http.ResponseWriter, r *http.Request)) GRPCGatewayOption
- func WithHttpPreHandlerInterceptorOptions(handlers ...func(w http.ResponseWriter, r *http.Request) error) GRPCGatewayOption
- func WithServerInterceptorsHTTPForwardResponseOptions() GRPCGatewayOption
- func WithServerInterceptorsHttpErrorOptions() GRPCGatewayOption
- func WithServerInterceptorsLimitRateOptions(burstUnary, burstStream int) GRPCGatewayOption
- func WithServerInterceptorsLogrusOptions(logger *logrus.Logger) GRPCGatewayOption
- func WithServerInterceptorsRecoveryOptions() GRPCGatewayOption
- func WithServerInterceptorsTCloud30HTTPResponseOptions() GRPCGatewayOption
- func WithServerOptions(opts ...grpc.ServerOption) GRPCGatewayOption
- func WithServerStreamInterceptorsOptions(opts ...grpc.StreamServerInterceptor) GRPCGatewayOption
- func WithServerUnaryInterceptorsCodeMessageOptions(enabledMetric bool) GRPCGatewayOption
- func WithServerUnaryInterceptorsErrorOptions() GRPCGatewayOption
- func WithServerUnaryInterceptorsInOutPacketOptions() GRPCGatewayOption
- func WithServerUnaryInterceptorsOptions(opts ...grpc.UnaryServerInterceptor) GRPCGatewayOption
- func WithServerUnaryInterceptorsRequestIdOptions() GRPCGatewayOption
- func WithServerUnaryInterceptorsTimerOptions(enabledMetric bool) GRPCGatewayOption
- type GRPCGatewayOptionFunc
- type GRPCHandler
- type GRPCHandlerFunc
- type HTTPHandler
- type HTTPHandlerFunc
- type InterceptorOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyGRPCGatewayOption ¶
type EmptyGRPCGatewayOption struct{}
EmptyGRPCGatewayOption does not alter the configuration. It can be embedded in another structure to build custom options.
This API is EXPERIMENTAL.
type GRPCGateway ¶
type GRPCGateway struct { http.Server //assigned by ginRouter in PrepareRun Handler http.Handler // contains filtered or unexported fields }
func NewGRPCGateWay ¶
func NewGRPCGateWay(addr string, options ...GRPCGatewayOption) *GRPCGateway
func (*GRPCGateway) ApplyOptions ¶
func (o *GRPCGateway) ApplyOptions(options ...GRPCGatewayOption) *GRPCGateway
func (*GRPCGateway) ListenAndServe ¶
func (g *GRPCGateway) ListenAndServe() error
func (*GRPCGateway) RegisterGRPCHandler ¶
func (g *GRPCGateway) RegisterGRPCHandler(h func(srv *grpc.Server))
func (*GRPCGateway) RegisterHTTPHandler ¶
func (*GRPCGateway) ServeHTTP ¶ added in v0.0.74
func (g *GRPCGateway) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP, wrap g.gateMux httpServerOpts, and called by grpcHandlerFunc
type GRPCGatewayOption ¶
type GRPCGatewayOption interface {
// contains filtered or unexported methods
}
A GRPCGatewayOption sets options.
func WithClientDialOptions ¶
func WithClientDialOptions(opts ...grpc.DialOption) GRPCGatewayOption
func WithGatewayMuxOptions ¶ added in v0.0.28
func WithGatewayMuxOptions(opts ...runtime.ServeMuxOption) GRPCGatewayOption
func WithHttpHandlerInterceptorInOutPacketOptions ¶ added in v0.0.74
func WithHttpHandlerInterceptorInOutPacketOptions() GRPCGatewayOption
func WithHttpHandlerInterceptorOptions ¶ added in v0.0.68
func WithHttpHandlerInterceptorOptions(handlers ...http_.HandlerInterceptor) GRPCGatewayOption
WithHttpHandlerInterceptorOptions
func WithHttpHandlerInterceptorTraceIDOptions ¶ added in v0.0.68
func WithHttpHandlerInterceptorTraceIDOptions() GRPCGatewayOption
WithHttpHandlerInterceptorTraceIDOptions
func WithHttpHandlerInterceptorsTimerOptions ¶ added in v0.0.74
func WithHttpHandlerInterceptorsTimerOptions(enabledMetric bool) GRPCGatewayOption
func WithHttpPostHandlerInterceptorOptions ¶ added in v0.0.74
func WithHttpPostHandlerInterceptorOptions( handlers ...func(w http.ResponseWriter, r *http.Request), ) GRPCGatewayOption
WithHttpPostHandlerInterceptorOptions
func WithHttpPreHandlerInterceptorOptions ¶ added in v0.0.74
func WithHttpPreHandlerInterceptorOptions( handlers ...func(w http.ResponseWriter, r *http.Request) error, ) GRPCGatewayOption
WithHttpPreHandlerInterceptorOptions
func WithServerInterceptorsHTTPForwardResponseOptions ¶ added in v0.0.28
func WithServerInterceptorsHTTPForwardResponseOptions() GRPCGatewayOption
now unused, only called by successed response
func WithServerInterceptorsHttpErrorOptions ¶ added in v0.0.28
func WithServerInterceptorsHttpErrorOptions() GRPCGatewayOption
HTTP, only called by failed response
func WithServerInterceptorsLimitRateOptions ¶ added in v0.0.31
func WithServerInterceptorsLimitRateOptions(burstUnary, burstStream int) GRPCGatewayOption
limiter rate for grpc api
func WithServerInterceptorsLogrusOptions ¶ added in v0.0.28
func WithServerInterceptorsLogrusOptions( logger *logrus.Logger, ) GRPCGatewayOption
func WithServerInterceptorsRecoveryOptions ¶ added in v0.0.38
func WithServerInterceptorsRecoveryOptions() GRPCGatewayOption
recover
func WithServerInterceptorsTCloud30HTTPResponseOptions ¶ added in v0.0.28
func WithServerInterceptorsTCloud30HTTPResponseOptions() GRPCGatewayOption
tcloud api3.0 http response formatter
func WithServerOptions ¶
func WithServerOptions(opts ...grpc.ServerOption) GRPCGatewayOption
func WithServerStreamInterceptorsOptions ¶ added in v0.0.27
func WithServerStreamInterceptorsOptions(opts ...grpc.StreamServerInterceptor) GRPCGatewayOption
func WithServerUnaryInterceptorsCodeMessageOptions ¶ added in v0.0.36
func WithServerUnaryInterceptorsCodeMessageOptions(enabledMetric bool) GRPCGatewayOption
func WithServerUnaryInterceptorsErrorOptions ¶ added in v0.0.28
func WithServerUnaryInterceptorsErrorOptions() GRPCGatewayOption
func WithServerUnaryInterceptorsInOutPacketOptions ¶ added in v0.0.57
func WithServerUnaryInterceptorsInOutPacketOptions() GRPCGatewayOption
func WithServerUnaryInterceptorsOptions ¶ added in v0.0.27
func WithServerUnaryInterceptorsOptions(opts ...grpc.UnaryServerInterceptor) GRPCGatewayOption
func WithServerUnaryInterceptorsRequestIdOptions ¶ added in v0.0.28
func WithServerUnaryInterceptorsRequestIdOptions() GRPCGatewayOption
func WithServerUnaryInterceptorsTimerOptions ¶ added in v0.0.28
func WithServerUnaryInterceptorsTimerOptions(enabledMetric bool) GRPCGatewayOption
type GRPCGatewayOptionFunc ¶
type GRPCGatewayOptionFunc func(*GRPCGateway)
GRPCGatewayOptionFunc wraps a function that modifies Client into an implementation of the GRPCGatewayOption interface.
type GRPCHandler ¶
type GRPCHandlerFunc ¶
func (GRPCHandlerFunc) Register ¶
func (h GRPCHandlerFunc) Register(srv *grpc.Server)
type HTTPHandler ¶
type HTTPHandlerFunc ¶
type InterceptorOption ¶ added in v0.0.27
type InterceptorOption struct {
// contains filtered or unexported fields
}