Back to godoc.org

Package heartbeat

v0.0.0-...-e388399
Latest Go to latest

The latest major version is .

Published: Mar 17, 2020 | License: GPL3 | Module: github.com/Southclaws/cj

Index

type ActionProvider

type ActionProvider interface {
	Init(*types.Config, *discord.Session, storage.Storer, *forum.ForumClient) (string, error)
	Register() []common.Action
}

ActionProvider describes a type that provides a registration function that provides a set of actions that have some random chance to be called on a schedule. The `chance` parameter controls the probability the `call` function is called each time a cron job specified by `schedule` occurs.

type Heartbeat

type Heartbeat struct {
	Config  *types.Config
	Discord *discord.Session
	Storage storage.Storer
	Forum   *forum.ForumClient
}

Heartbeat controls a set of plugins that do stuff periodically.

func (*Heartbeat) Init

func (a *Heartbeat) Init(
	config *types.Config,
	discord *discord.Session,
	api storage.Storer,
	fc *forum.ForumClient,
) (err error)

nolint:golint

func (*Heartbeat) OnMessage

func (a *Heartbeat) OnMessage(discordgo.Message) (err error)

nolint:golint

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier