Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterTriggerDriver(name string, fn NewTriggerFunc)
- func TriggerDrivers() []string
- type Attachment
- type ClientOption
- type ErrorHandlerFunc
- type Image
- type IncomingClient
- type IncomingResponse
- type Message
- type NewTriggerFunc
- type Outgoing
- type OutgoingOption
- type OutgoingRequest
- type OutgoingSettings
- type Trigger
- type TriggerHandleFunc
Constants ¶
View Source
const (
OUTGOING = "gogap-outgoing"
)
Variables ¶
Functions ¶
func RegisterTriggerDriver ¶
func RegisterTriggerDriver(name string, fn NewTriggerFunc)
func TriggerDrivers ¶
func TriggerDrivers() []string
Types ¶
type Attachment ¶
type ClientOption ¶
type ClientOption func(*IncomingClient)
func TimeoutOption ¶
func TimeoutOption(timeout time.Duration) ClientOption
func TransportOption ¶
func TransportOption(transport *http.Transport) ClientOption
type ErrorHandlerFunc ¶
type IncomingClient ¶
type IncomingClient struct {
// contains filtered or unexported fields
}
func NewIncomingClient ¶
func NewIncomingClient(opts ...ClientOption) *IncomingClient
func (*IncomingClient) Options ¶
func (p *IncomingClient) Options(opts ...ClientOption)
func (*IncomingClient) Send ¶
func (p *IncomingClient) Send(url string, msg *Message) (resp *IncomingResponse, err error)
type IncomingResponse ¶
type IncomingResponse struct { Code int `json:"code"` Error string `json:"error"` Result interface{} `json:"result"` }
func (*IncomingResponse) Err ¶
func (p *IncomingResponse) Err() error
type NewTriggerFunc ¶
type NewTriggerFunc func(word string, config *configuration.Config) (Trigger, error)
type Outgoing ¶
type Outgoing struct {
// contains filtered or unexported fields
}
func NewOutgoing ¶
func NewOutgoing(config *configuration.Config) (*Outgoing, error)
func (*Outgoing) BindTrigger ¶
func (p *Outgoing) BindTrigger(config *configuration.Config) *Outgoing
func (*Outgoing) HandleHttpRequest ¶
func (p *Outgoing) HandleHttpRequest(rw http.ResponseWriter, req *http.Request)
func (*Outgoing) SetErrorHandler ¶
func (p *Outgoing) SetErrorHandler(handler ErrorHandlerFunc)
type OutgoingOption ¶
type OutgoingOption func(*OutgoingSettings)
type OutgoingRequest ¶
type OutgoingRequest struct { Token string `json:"token"` Timestamp int `json:"ts"` Text string `json:"text"` TriggerWord string `json:"trigger_word"` Subdomain string `json:"subdomain"` ChannelName string `json:"channel_name"` UserName string `json:"user_name"` Commands []string `json:"-"` }
func (*OutgoingRequest) Args ¶
func (p *OutgoingRequest) Args() []string
type OutgoingSettings ¶
type OutgoingSettings struct { }
func NewOutgoingSettings ¶
func NewOutgoingSettings(config *configuration.Config) *OutgoingSettings
type Trigger ¶
type Trigger interface {
Handle(*OutgoingRequest, *Message) error
}
func NewOutgoingTrigger ¶
func NewOutgoingTrigger(word string, config *configuration.Config) (Trigger, error)
type TriggerHandleFunc ¶
type TriggerHandleFunc func(req *OutgoingRequest, msg *Message) (err error)
Click to show internal directories.
Click to hide internal directories.