helperbot/interfaces.go

27 lines
552 B
Go
Raw Normal View History

2019-11-13 00:45:56 +00:00
package helperbot
2019-11-21 23:45:04 +00:00
import "github.com/nlopes/slack"
2019-11-13 00:45:56 +00:00
type Model interface {
SendMessage(src, dest string, message slack.Message)
GetSlackAdminDMId() (string, error)
2019-11-13 00:45:56 +00:00
GetBytes(path []string) ([]byte, error)
SetBytes(path []string, val []byte) error
GetString(path []string) (string, error)
SetString(path []string, val string) error
}
type Message interface {
GetSource() string
GetDestination() string
GetMessage() slack.Message
}
type PluginState interface {
Name() string
Initialize(Model) error
ProcessMessage(Message)
Run()
Exit()
}