botbuilder

package
v0.0.0-...-e99bdf9 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot models an assistant bot.

func NewBot

func NewBot(name string, opts BotOpts) (*Bot, error)

NewBot creates a new bot instance.

func (*Bot) ScheduleTask

func (bot *Bot) ScheduleTask(schedule string, task Task)

ScheduleTask schedules a task to run on a regular basis.

func (*Bot) Start

func (bot *Bot) Start()

Start starts the bot.

type BotOpts

type BotOpts struct {
	// Notifiers are things used to send notifications about things
	// that have happened.
	Notifiers []notifier.Notifier

	// NotificationLevel is the minimum level of notifications that
	// are allowed to be sent at a global level.
	NotificationLevel notifier.Status

	// MaxConcurrency sets the maximum number of concurrently running
	// tasks. If unset a default concurrency amount is used.
	MaxConcurrency int
}

BotOpts are options used to configure a newly created bot.

type Task

type Task struct {
	Name    string
	Handler func()
}

Task is a unit of work that can be scheduled and run.

func (Task) String

func (task Task) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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