pingu

package
v0.0.0-...-7b0f4a5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SymbolName = "New"

Variables

This section is empty.

Functions

func LoadPlugins

func LoadPlugins(dir string) ([]func(*viper.Viper) Plugin, error)

Types

type Author

type Author struct {
	Email string
	Name  string
}

type Command

type Command struct {
	Description string
	Func        func(pi *Pingu, ev *slack.MessageEvent)
	Trigger     *regexp.Regexp
}

type Commands

type Commands []*Command

type Pingu

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

func New

func New(config *viper.Viper, logger *logrus.Logger) *Pingu

func (*Pingu) BuiltAt

func (p *Pingu) BuiltAt() time.Time

func (*Pingu) ConnectedAt

func (p *Pingu) ConnectedAt() time.Time

func (*Pingu) FriendlyVersion

func (p *Pingu) FriendlyVersion() string

func (*Pingu) Latency

func (p *Pingu) Latency() time.Duration

func (*Pingu) Logger

func (p *Pingu) Logger() *logrus.Logger

func (*Pingu) Name

func (p *Pingu) Name() string

func (*Pingu) Plugins

func (p *Pingu) Plugins() Plugins

func (*Pingu) Reply

func (p *Pingu) Reply(ev *slack.MessageEvent, msg string)

func (*Pingu) Run

func (p *Pingu) Run()

func (*Pingu) Say

func (p *Pingu) Say(msg string, ch string)

func (*Pingu) SendAttachments

func (p *Pingu) SendAttachments(attachments []slack.Attachment, msg string, ch string)

func (*Pingu) StartedAt

func (p *Pingu) StartedAt() time.Time

func (*Pingu) Version

func (p *Pingu) Version() string

type Plugin

type Plugin interface {
	Author() Author
	Commands() Commands
	Name() string
	Tasks() Tasks
	Version() string
}

type Plugins

type Plugins []Plugin

type Task

type Task struct {
	Func     func(pi *Pingu)
	Interval time.Duration
	Spec     string
}

type Tasks

type Tasks []*Task

Jump to

Keyboard shortcuts

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