Documentation ¶
Index ¶
- Constants
- func ClientDialOptions(options ...grpc.DialOption) []grpc.DialOption
- func GetClientIpCtxKey() string
- func GetTracingCtxKey() string
- func SetServerStatus(status HealthStatus)
- func SetTracing(fieldName, fieldNameKey, ctxKey string)
- func UnaryClientInterceptorOfContext() grpc.UnaryClientInterceptor
- func UnaryClientInterceptorOfDebug() grpc.UnaryClientInterceptor
- func UnaryClientInterceptorOfSessionId() grpc.UnaryClientInterceptor
- func UnaryServerInterceptorOfContext() grpc.UnaryServerInterceptor
- func UnaryServerInterceptorOfDebug() grpc.UnaryServerInterceptor
- func UnaryServerInterceptorOfRecovery() grpc.UnaryServerInterceptor
- func UnaryServerInterceptorOfSessionId() grpc.UnaryServerInterceptor
- type HandlerFromEndpoint
- type HealthStatus
- type ServerOption
- func WithAddr(ip string, port int) ServerOption
- func WithDialOptions(opts ...grpc.DialOption) ServerOption
- func WithGatewayOptions(opts ...runtime.ServeMuxOption) ServerOption
- func WithHealthz() ServerOption
- func WithHealthzPath(path string) ServerOption
- func WithPProf() ServerOption
- func WithPProfPath(path string) ServerOption
- func WithPort(port int) ServerOption
- func WithReflection() ServerOption
- func WithServerOptions(opts ...grpc.ServerOption) ServerOption
- type Webserver
- func (s *Webserver) GatewayMux() *runtime.ServeMux
- func (s *Webserver) GrpcServer() *grpc.Server
- func (s *Webserver) HttpMux() *http.ServeMux
- func (s *Webserver) RegisterGatewayHandlerFromEndpoint(endpoint string, opts []grpc.DialOption, ...)
- func (s *Webserver) RegisterGatewayHandlerWithDefault(handlerFromEndpoint HandlerFromEndpoint)
- func (s *Webserver) RegisterGrpcServer(fn func(srv *grpc.Server))
- func (s *Webserver) RegisterHttpHandler(pattern string, handler http.Handler)
- func (s *Webserver) Serve() error
- func (s *Webserver) ServeTLS() error
- func (s *Webserver) Stop()
Constants ¶
View Source
const ( UnknownStatus = HealthStatus(pb.HealthCheckResponse_UNKNOWN) ServingStatus = HealthStatus(pb.HealthCheckResponse_SERVING) NotServingStatus = HealthStatus(pb.HealthCheckResponse_NOT_SERVING) ServiceUnknownStatus = HealthStatus(pb.HealthCheckResponse_SERVICE_UNKNOWN) )
View Source
const ( ServerMaxReceiveMessageSize = 4 * 1024 * 1024 * 1024 // 4GB ServerMaxSendMessageSize = math.MaxInt32 ClientMaxReceiveMessageSize = 4 * 1024 * 1024 * 1024 // 4GB ClientMaxSendMessageSize = math.MaxInt32 )
Variables ¶
This section is empty.
Functions ¶
func ClientDialOptions ¶
func ClientDialOptions(options ...grpc.DialOption) []grpc.DialOption
func GetClientIpCtxKey ¶
func GetClientIpCtxKey() string
func GetTracingCtxKey ¶
func GetTracingCtxKey() string
func SetServerStatus ¶
func SetServerStatus(status HealthStatus)
func SetTracing ¶
func SetTracing(fieldName, fieldNameKey, ctxKey string)
SetTracing fieldName for proto field name, fieldNameKey for log key, ctxKey for context key
func UnaryClientInterceptorOfContext ¶
func UnaryClientInterceptorOfContext() grpc.UnaryClientInterceptor
func UnaryClientInterceptorOfDebug ¶
func UnaryClientInterceptorOfDebug() grpc.UnaryClientInterceptor
func UnaryClientInterceptorOfSessionId ¶
func UnaryClientInterceptorOfSessionId() grpc.UnaryClientInterceptor
func UnaryServerInterceptorOfContext ¶
func UnaryServerInterceptorOfContext() grpc.UnaryServerInterceptor
func UnaryServerInterceptorOfDebug ¶
func UnaryServerInterceptorOfDebug() grpc.UnaryServerInterceptor
func UnaryServerInterceptorOfRecovery ¶
func UnaryServerInterceptorOfRecovery() grpc.UnaryServerInterceptor
func UnaryServerInterceptorOfSessionId ¶
func UnaryServerInterceptorOfSessionId() grpc.UnaryServerInterceptor
Types ¶
type HandlerFromEndpoint ¶
type HealthStatus ¶
type HealthStatus pb.HealthCheckResponse_ServingStatus
type ServerOption ¶
type ServerOption func(*Webserver)
func WithAddr ¶
func WithAddr(ip string, port int) ServerOption
func WithDialOptions ¶
func WithDialOptions(opts ...grpc.DialOption) ServerOption
func WithGatewayOptions ¶
func WithGatewayOptions(opts ...runtime.ServeMuxOption) ServerOption
func WithHealthz ¶
func WithHealthz() ServerOption
func WithHealthzPath ¶
func WithHealthzPath(path string) ServerOption
func WithPProf ¶
func WithPProf() ServerOption
func WithPProfPath ¶
func WithPProfPath(path string) ServerOption
func WithPort ¶
func WithPort(port int) ServerOption
func WithReflection ¶
func WithReflection() ServerOption
func WithServerOptions ¶
func WithServerOptions(opts ...grpc.ServerOption) ServerOption
type Webserver ¶
type Webserver struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ...ServerOption) *Webserver
func (*Webserver) GatewayMux ¶
func (*Webserver) GrpcServer ¶
func (*Webserver) RegisterGatewayHandlerFromEndpoint ¶
func (s *Webserver) RegisterGatewayHandlerFromEndpoint( endpoint string, opts []grpc.DialOption, handlerFromEndpoint HandlerFromEndpoint, )
func (*Webserver) RegisterGatewayHandlerWithDefault ¶
func (s *Webserver) RegisterGatewayHandlerWithDefault(handlerFromEndpoint HandlerFromEndpoint)
func (*Webserver) RegisterGrpcServer ¶
func (*Webserver) RegisterHttpHandler ¶
Click to show internal directories.
Click to hide internal directories.