Documentation ¶
Index ¶
- Constants
- type Config
- type Controller
- func (c *Controller) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
- func (c *Controller) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error
- func (c *Controller) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (*common.CommandResult, error)
- func (c *Controller) Shutdown() error
- func (c *Controller) Start() error
- func (c *Controller) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
- func (c *Controller) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
Constants ¶
View Source
const ( // ProtoVersions contains a comma-seprated list of compatible RPC protos versions // (we pass it as request meta to notify clients) ProtoVersions = "v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.0.1
type Config struct { // RPC instance host Host string // The max number of simulteneous requests. // Should be slightly less than the RPC server concurrency to avoid // ResourceExhausted errors Concurrency int // Enable client-side TLS on RPC connections? EnableTLS bool }
Config contains RPC controller configuration
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller implements node.Controller interface for gRPC
func NewController ¶
func NewController(metrics *metrics.Metrics, config *Config) *Controller
NewController builds new Controller
func (*Controller) Authenticate ¶
func (c *Controller) Authenticate(sid string, env *common.SessionEnv) (*common.ConnectResult, error)
Authenticate performs Connect RPC call
func (*Controller) Disconnect ¶
func (c *Controller) Disconnect(sid string, env *common.SessionEnv, id string, subscriptions []string) error
Disconnect performs disconnect RPC call
func (*Controller) Perform ¶
func (c *Controller) Perform(sid string, env *common.SessionEnv, id string, channel string, data string) (*common.CommandResult, error)
Perform performs Command RPC call with "perform" command
func (*Controller) Subscribe ¶
func (c *Controller) Subscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
Subscribe performs Command RPC call with "subscribe" command
func (*Controller) Unsubscribe ¶
func (c *Controller) Unsubscribe(sid string, env *common.SessionEnv, id string, channel string) (*common.CommandResult, error)
Unsubscribe performs Command RPC call with "unsubscribe" command
Click to show internal directories.
Click to hide internal directories.