Documentation ¶
Overview ¶
Package grpc provides a grpc server
Index ¶
- Constants
- func Codec(contentType string, c encoding.Codec) server.Option
- func MaxMsgSize(s int) server.Option
- func Options(opts ...grpc.ServerOption) server.Option
- func Reflection(r Reflector) server.Option
- func UnknownServiceHandler(h grpc.StreamHandler) server.Option
- type Reflector
- type Server
- func (g *Server) Deregister() error
- func (g *Server) GRPCServer() *grpc.Server
- func (g *Server) Handle(h server.Handler) error
- func (g *Server) Health() bool
- func (g *Server) Init(opts ...server.Option) error
- func (g *Server) Live() bool
- func (g *Server) Name() string
- func (g *Server) NewHandler(h interface{}, opts ...server.HandlerOption) server.Handler
- func (g *Server) NewSubscriber(topic string, sb interface{}, opts ...server.SubscriberOption) server.Subscriber
- func (g *Server) Options() server.Options
- func (g *Server) Ready() bool
- func (g *Server) Register() error
- func (g *Server) Start() error
- func (g *Server) Stop() error
- func (g *Server) String() string
- func (g *Server) Subscribe(sb server.Subscriber) error
Constants ¶
View Source
const ( // ReflectV1ServiceName is the fully-qualified name of the v1 version of the reflection service. ReflectV1ServiceName = "grpc.reflection.v1.ServerReflection" // ReflectServiceURLPathV1 is the full path for reflection service endpoint ReflectServiceURLPathV1 = "/" + ReflectV1ServiceName + "/" // ReflectMethodName is the reflection service name ReflectMethodName = "ServerReflectionInfo" )
View Source
const (
DefaultContentType = "application/grpc"
)
Variables ¶
This section is empty.
Functions ¶
func MaxMsgSize ¶
MaxMsgSize set the maximum message in bytes the server can receive and send. Default maximum message size is 4 MB.
func Options ¶
func Options(opts ...grpc.ServerOption) server.Option
Options to be used to configure gRPC options
func Reflection ¶
Reflection enables reflection support in grpc server
func UnknownServiceHandler ¶ added in v3.9.1
func UnknownServiceHandler(h grpc.StreamHandler) server.Option
UnknownServiceHandler enables support for all services
Types ¶
type Reflector ¶ added in v3.10.10
type Reflector interface { protodesc.Resolver reflection.ServiceInfoProvider reflection.ExtensionResolver }
type Server ¶ added in v3.10.2
func (*Server) Deregister ¶ added in v3.10.2
func (*Server) GRPCServer ¶ added in v3.10.2
func (*Server) NewHandler ¶ added in v3.10.2
func (g *Server) NewHandler(h interface{}, opts ...server.HandlerOption) server.Handler
func (*Server) NewSubscriber ¶ added in v3.10.2
func (g *Server) NewSubscriber(topic string, sb interface{}, opts ...server.SubscriberOption) server.Subscriber
Source Files ¶
Click to show internal directories.
Click to hide internal directories.