Documentation
¶
Index ¶
- Constants
- type Config
- type Proxy
- type Service
- func (s *Service) AddListener(l func(event int, ctx interface{}))
- func (s *Service) AddOption(opt grpc.ServerOption)
- func (s *Service) AddService(r func(server *grpc.Server)) error
- func (s *Service) Init(cfg *Config, r *rpc.Service, e env.Environment) (ok bool, err error)
- func (s *Service) Serve() (err error)
- func (s *Service) Stop()
- type TLS
- type WorkerList
Constants ¶
View Source
const ID = "grpc"
ID sets public GRPC service ID for roadrunner.Container.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Address to listen.
Listen string
// Proto file associated with the service.
Proto string
// TLS defined authentication method (TLS for now).
TLS TLS
// Workers configures roadrunner grpc and worker pool.
Workers *roadrunner.ServerConfig
}
Config describes GRPC service configuration.
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy manages GRPC/RoadRunner bridge.
func NewProxy ¶
func NewProxy(name string, metadata string, rr *roadrunner.Server) *Proxy
NewProxy creates new service proxy object.
func (*Proxy) RegisterMethod ¶
RegisterMethod registers new RPC method.
func (*Proxy) ServiceDesc ¶
func (p *Proxy) ServiceDesc() *grpc.ServiceDesc
ServiceDesc returns service description for the proxy.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages set of GPRC registerServices, options and connections.
func (*Service) AddListener ¶
AddListener attaches grpc event watcher.
func (*Service) AddOption ¶
func (s *Service) AddOption(opt grpc.ServerOption)
AddOption adds new GRPC server option. Codec and TLS options are controlled by service internally.
func (*Service) AddService ¶
AddService would be invoked after GRPC service creation.
type TLS ¶
type TLS struct {
// Key defined private server key.
Key string
// Cert is https certificate.
Cert string
}
TLS defines auth credentials.
type WorkerList ¶
WorkerList contains list of workers.
Click to show internal directories.
Click to hide internal directories.