Documentation ¶
Index ¶
- Constants
- type Config
- type Plugin
- func (s *Plugin) Client() (*rpc.Client, error)
- func (s *Plugin) Collects() []interface{}
- func (s *Plugin) Init(cfg config.Configurer, log log.Logger) error
- func (s *Plugin) Name() string
- func (s *Plugin) Register(name string, svc interface{}) error
- func (s *Plugin) RegisterPlugin(name endure.Named, p rpc_.RPCer)
- func (s *Plugin) Serve() chan error
- func (s *Plugin) Stop() error
Constants ¶
View Source
const ServiceName = "RPC"
ServiceName contains default service name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Listen string Listen string // Disabled disables RPC service. Disabled bool }
Config defines RPC service config.
func (*Config) InitDefaults ¶
func (c *Config) InitDefaults()
InitDefaults allows to init blank config with pre-defined set of default values.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is RPC service.
func (*Plugin) Collects ¶
func (s *Plugin) Collects() []interface{}
Depends declares services to collect for RPC.
func (*Plugin) Register ¶
Register publishes in the server the set of methods of the receiver value that satisfy the following conditions:
- exported method of exported type
- two arguments, both of exported type
- the second argument is a pointer
- one return value, of type error
It returns an error if the receiver is not an exported type or has no suitable methods. It also logs the error using package log.
func (*Plugin) RegisterPlugin ¶
RegisterPlugin registers RPC service plugin.
Click to show internal directories.
Click to hide internal directories.