Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Type string `mapstructure:"type"` Host string `mapstructure:"host"` Port int `mapstructure:"port"` URL string `mapstructure:"url"` Token string `mapstructure:"token"` }
Config contains all the require parameters to communicate with an extension
type Extension ¶
type Extension interface { GetAllExtensions() ([]string, error) ExecuteExtension(question *query.Question, extensionName, channel, command string, fsmDomain *fsm.Domain, machine *fsm.FSM) ([]query.Answer, error) }
Extension is a service (REST or RPC) that executes commands and returns an answer to the Chatto bot. Extensions are written in any language and do whatever you want.
type REST ¶
type REST struct { URL string // contains filtered or unexported fields }
REST is a REST Client for extension command functions
func (*REST) ExecuteExtension ¶ added in v0.7.0
func (e *REST) ExecuteExtension(question *query.Question, ext, chn, cmd string, fsmDomain *fsm.Domain, machine *fsm.FSM) ([]query.Answer, error)
ExecuteExtension runs the requested command function and returns the response
func (*REST) GetAllExtensions ¶ added in v0.7.0
GetAllExtensions returns all command functions in the extension as a list of strings
type RPC ¶
RPC is an RPC Client for extension command functions
func (*RPC) ExecuteExtension ¶ added in v0.7.0
func (e *RPC) ExecuteExtension(question *query.Question, ext, chn, cmd string, fsmDomain *fsm.Domain, machine *fsm.FSM) ([]query.Answer, error)
ExecuteExtension runs the requested command function and returns the response
func (*RPC) GetAllExtensions ¶ added in v0.7.0
GetAllExtensions returns all command functions in the extension as a list of strings