common

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttachmentTypeUnknown = ""
	AttachmentTypeText    = "text"
	AttachmentTypeImage   = "image"
)

Variables

This section is empty.

Functions

func LoadTemplate

func LoadTemplate(name, tmpl string) (*template.Template, error)

func LoadYaml

func LoadYaml(config string, obj interface{}) (bool, error)

func RemoveEmptyStrings added in v0.0.3

func RemoveEmptyStrings(items []string) []string

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
	Info() interface{}
}

type Bots

type Bots struct {
	// contains filtered or unexported fields
}

func NewBots

func NewBots() *Bots

func (*Bots) Add

func (bs *Bots) Add(b Bot)

func (*Bots) Start

func (bs *Bots) Start(wg *sync.WaitGroup)

type Command

type Command interface {
	Name() string
	Description() string
	Params() []string
	Aliases() []string
	Execute(bot Bot, user User, params ExecuteParams) (string, []*Attachment, error)
}

type ExecuteParams

type ExecuteParams = map[string]string

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) Warn

func (o *Observability) Warn(obj interface{}, args ...interface{})

type Processor

type Processor interface {
	Name() string
	Commands() []Command
}

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) Items

func (ps *Processors) Items() []Processor

type User

type User interface {
	ID() string
	Name() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL