Documentation
¶
Index ¶
- Constants
- func GetStringKeys(arr map[string]interface{}) []string
- func IfDef(cond bool, v1, v2 interface{}) interface{}
- func InterfaceListAsStrings(items []interface{}) []string
- func LoadTemplate(name, tmpl string) (*template.Template, error)
- func LoadYaml(config string, obj interface{}) (bool, error)
- func MergeInterfaceMaps(maps ...map[string]interface{}) map[string]interface{}
- func RemoveEmptyStrings(items []string) []string
- func Render(def string, obj interface{}, observability *Observability) string
- func RenderTemplate(tpl *toolsRender.TextTemplate, def string, obj interface{}) (string, error)
- func Schedule(what func(), delay time.Duration) chan bool
- func UUID() string
- type Action
- type Approval
- type Attachment
- type AttachmentType
- type Bot
- type Bots
- type Channel
- type Command
- type ExecuteParams
- type Executor
- type Field
- type FieldType
- type Message
- type Observability
- func (o *Observability) Debug(obj interface{}, args ...interface{})
- func (o *Observability) Error(obj interface{}, args ...interface{})
- func (o *Observability) Info(obj interface{}, args ...interface{})
- func (o *Observability) Logs() *sre.Logs
- func (o *Observability) Metrics() *sre.Metrics
- func (o *Observability) Panic(obj interface{}, args ...interface{})
- func (o *Observability) Warn(obj interface{}, args ...interface{})
- type Processor
- type Processors
- func (ps *Processors) Add(p Processor)
- func (ps *Processors) AddList(list []Processor)
- func (ps *Processors) Exists(processor string) bool
- func (ps *Processors) FindCommand(processor, command string) Command
- func (ps *Processors) FindCommandByAlias(alias string) (string, Command)
- func (ps *Processors) Items() []Processor
- type Response
- type User
Constants ¶
View Source
const ( AttachmentTypeUnknown = "" AttachmentTypeText = "text" AttachmentTypeImage = "image" AttachmentTypeFile = "file" )
View Source
const ( FileTypeUnknown = "" FileTypeText = "text" FileTypeImage = "image" )
View Source
const ( FieldTypeUnknown = "" FieldTypeEdit = "edit" FieldTypeMultiEdit = "multiedit" FieldTypeInteger = "integer" FieldTypeFloat = "float" FieldTypeURL = "url" FieldTypeDate = "date" FieldTypeTime = "time" FieldTypeSelect = "select" FieldTypeMultiSelect = "multiselect" FieldTypeDynamicSelect = "dynamicselect" FieldTypeDynamicMultiSelect = "dynamicmultiselect" FieldTypeRadionButtons = "radiobuttons" FieldTypeCheckboxes = "checkboxes" FieldTypeBool = "bool" FieldTypeMarkdown = "markdown" FieldTypeUser = "user" FieldTypeMultiUser = "multiuser" FieldTypeChannel = "channel" FieldTypeMultiChannel = "multichannel" FieldTypeGroup = "group" FieldTypeMultiGroup = "multigroup" )
Variables ¶
This section is empty.
Functions ¶
func GetStringKeys ¶ added in v0.1.1
func InterfaceListAsStrings ¶ added in v0.10.9
func InterfaceListAsStrings(items []interface{}) []string
func MergeInterfaceMaps ¶ added in v0.3.4
func RemoveEmptyStrings ¶ added in v0.0.3
func Render ¶ added in v0.5.0
func Render(def string, obj interface{}, observability *Observability) string
func RenderTemplate ¶ added in v0.5.0
func RenderTemplate(tpl *toolsRender.TextTemplate, def string, obj interface{}) (string, error)
Types ¶
type Attachment ¶
type Attachment struct {
Title string
Text string
Data []byte
Type AttachmentType
}
type AttachmentType ¶ added in v0.0.2
type AttachmentType string
type Bot ¶
type Bot interface {
Start(wg *sync.WaitGroup)
Name() string
Command(channel, text string, user User, parent Message, response Response) error
AddReaction(channel, ID, name string) error
RemoveReaction(channel, ID, name string) error
AddAction(channel, ID string, action Action) error
AddActions(channel, ID string, actions []Action) error
RemoveAction(channel, ID, name string) error
ClearActions(channel, ID string) error
PostMessage(channel string, message string, attachments []*Attachment, actions []Action, user User, parent Message, response Response) (string, error)
DeleteMessage(channel, ID string) error
ReadMessage(channel, ID string) (string, error)
UpdateMessage(channel, ID, message string) error
}
type Command ¶
type Command interface {
Name() string
Group() string
Description() string
Params() []string
Aliases() []string
Confirmation(params ExecuteParams) string
Priority() int
Wrapper() bool
Schedule() string
Channel() string
Response() Response
Actions() []Action
Approval() Approval
Permissions() bool
Execute(bot Bot, message Message, params ExecuteParams, action Action) (Executor, string, []*Attachment, []Action, error)
Fields(bot Bot, message Message, params ExecuteParams, eval []string) []Field
}
type ExecuteParams ¶
type ExecuteParams = map[string]interface{}
type Field ¶ added in v0.1.0
type Observability ¶
type Observability struct {
// contains filtered or unexported fields
}
func NewObservability ¶
func NewObservability(logs *sre.Logs, metrics *sre.Metrics) *Observability
func (*Observability) Debug ¶
func (o *Observability) Debug(obj interface{}, args ...interface{})
func (*Observability) Error ¶
func (o *Observability) Error(obj interface{}, args ...interface{})
func (*Observability) Info ¶
func (o *Observability) Info(obj interface{}, args ...interface{})
func (*Observability) Logs ¶
func (o *Observability) Logs() *sre.Logs
func (*Observability) Metrics ¶
func (o *Observability) Metrics() *sre.Metrics
func (*Observability) Panic ¶ added in v0.7.4
func (o *Observability) Panic(obj interface{}, args ...interface{})
func (*Observability) Warn ¶
func (o *Observability) Warn(obj interface{}, args ...interface{})
type Processors ¶
type Processors struct {
// contains filtered or unexported fields
}
func NewProcessors ¶
func NewProcessors() *Processors
func (*Processors) Add ¶
func (ps *Processors) Add(p Processor)
func (*Processors) AddList ¶
func (ps *Processors) AddList(list []Processor)
func (*Processors) Exists ¶ added in v0.5.0
func (ps *Processors) Exists(processor string) bool
func (*Processors) FindCommand ¶ added in v0.5.0
func (ps *Processors) FindCommand(processor, command string) Command
func (*Processors) FindCommandByAlias ¶ added in v0.5.1
func (ps *Processors) FindCommandByAlias(alias string) (string, Command)
func (*Processors) Items ¶
func (ps *Processors) Items() []Processor
Click to show internal directories.
Click to hide internal directories.