helperbot/interfaces.go

35 lines
706 B
Go

package helperbot
import (
"time"
"github.com/nlopes/slack"
)
type Model interface {
SendMessage(src, dest string, message slack.Message)
GetSlackAdminDMId() (string, error)
GetSlackLatency() time.Duration
GetBytes(path []string) ([]byte, error)
SetBytes(path []string, val []byte) error
GetString(path []string) (string, error)
SetString(path []string, val string) error
GetInt(path []string) (int, error)
SetInt(path []string, val int) error
}
type Message interface {
GetSource() string
GetDestination() string
GetMessage() slack.Message
}
type PluginState interface {
Name() string
Initialize(Model) error
ProcessMessage(Message)
ProcessRTMEvent(slack.RTMEvent)
Run()
Exit()
}