Documentation ¶
Index ¶
- func SetAccessLog(accessLog AccessLog)
- func SetMetricsRecord(metricsRecord MetricsRecord)
- func Start(s *Server)
- func StreamAccess(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (err error)
- func StreamValidator(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (err error)
- func UnaryAccess(conf *Config) grpc.UnaryServerInterceptor
- func UnaryValidator(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- type AccessLog
- type Config
- type Http
- type Http3
- type HttpOption
- type MetricsRecord
- type Server
- type ServerOption
- type StaticFsConfig
- type TelemetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetAccessLog ¶
func SetAccessLog(accessLog AccessLog)
func SetMetricsRecord ¶
func SetMetricsRecord(metricsRecord MetricsRecord)
func StreamAccess ¶
func StreamAccess(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
func StreamValidator ¶
func StreamValidator(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
func UnaryAccess ¶
func UnaryAccess(conf *Config) grpc.UnaryServerInterceptor
func UnaryValidator ¶
func UnaryValidator( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (resp interface{}, err error)
Types ¶
type Config ¶
type Config struct { ServerName string Http Http Http2 http2.Server Http3 *Http3 `json:"http3"` StopTimeout time.Duration Gin gini.Config `json:"gin"` EnableCors bool Cors *cors.Options `json:"cors"` Middlewares []http.HandlerFunc HttpOption HttpOption // Grpc options GrpcOptions []grpc.ServerOption EnableGrpcWeb bool GrpcWebOption []web.Option `json:"grpc_web"` EnableTelemetry, EnableDebugApi, GenerateDoc bool TelemetryConfig BaseContext func() context.Context }
func (*Config) InitAfterInject ¶ added in v1.16.5
func (c *Config) InitAfterInject()
func (*Config) InitBeforeInject ¶ added in v1.16.5
func (c *Config) InitBeforeInject()
implement initialize
type HttpOption ¶
type HttpOption struct { ExcludeLogPrefixes []string IncludeLogPrefixes []string StaticFs []StaticFsConfig `json:"static_fs"` Middlewares []http.HandlerFunc }
type Server ¶
type Server struct { Config *Config // 注册 grpc 服务 GrpcHandler func(*grpc.Server) // 注册 grpc-gateway 服务 GatewayHandler runtime.GatewayHandler // 注册 gin 服务 GinHandler func(*gin.Engine) // 注册 graphql 服务 GraphqlHandler graphql.ExecutableSchema // 各种钩子函数 OnBeforeStart func(context.Context) OnAfterStart func(context.Context) OnBeforeStop func(context.Context) OnAfterStop func(context.Context) }
type StaticFsConfig ¶
type TelemetryConfig ¶
type TelemetryConfig struct { EnablePrometheus bool MetricsInterval time.Duration // contains filtered or unexported fields }
func (*TelemetryConfig) SetMeterProvider ¶
func (c *TelemetryConfig) SetMeterProvider(meterProvider *sdkmetric.MeterProvider)
func (*TelemetryConfig) SetTextMapPropagator ¶
func (c *TelemetryConfig) SetTextMapPropagator(propagator propagation.TextMapPropagator)
func (*TelemetryConfig) SetTracerProvider ¶
func (c *TelemetryConfig) SetTracerProvider(tracerProvider *sdktrace.TracerProvider)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
_example
|
|
protobuf/user
Package user is a reverse proxy.
|
Package user is a reverse proxy. |
gateway
|
|
Click to show internal directories.
Click to hide internal directories.