Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBotNotFound = errors.New("No Such registered team")
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector internally manages connections to slack teams.
ffjson: skip
func (*Connector) Open ¶
Open opens a websocket connection for the passed URL and assigns it to the given team.
func (*Connector) SetMessageHandler ¶
func (c *Connector) SetMessageHandler(messageHandler MessageHandler)
SetMessageHandler sets the message handler for the connector.
type MessageHandler ¶
MessageHandler is a callback to attach that is invoked whenever a new message is received
type MessagePayload ¶
type MessagePayload struct { Message json.RawMessage `json:"message"` Team string `json:"team"` }
MessagePayload is the payload received from slack over a connection.
func (*MessagePayload) MarshalJSON ¶
func (j *MessagePayload) MarshalJSON() ([]byte, error)
MarshalJSON marshal bytes to json - template
func (*MessagePayload) MarshalJSONBuf ¶
func (j *MessagePayload) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*MessagePayload) UnmarshalJSON ¶
func (j *MessagePayload) UnmarshalJSON(input []byte) error
UnmarshalJSON umarshall json - template of ffjson
func (*MessagePayload) UnmarshalJSONFFLexer ¶
func (j *MessagePayload) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
Click to show internal directories.
Click to hide internal directories.