rainfall

package
v0.0.0-...-531fd89 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RainfallPrefix = "rainfall"
)

Variables

View Source
var (
	CommandSyntaxError = errors.New("CommandSyntaxError")
)

Functions

This section is empty.

Types

type Command

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

func NewCommand

func NewCommand(p *plugin) *Command

func (*Command) Execute

func (c *Command) Execute(params []string) (string, error)

type CommandType

type CommandType string
const (
	CommandTypeAddLocation    CommandType = "add"
	CommandTypeRemoveLocation CommandType = "rm"
	CommandTypeChangeLocation CommandType = "change"
	CommandTypeListLocation   CommandType = "list"
	CommandTypeNone           CommandType = "none"
)

type Commander

type Commander interface {
	Execute(params []string) (string, error)
}

func NewAddCommand

func NewAddCommand(p *plugin) Commander

func NewAskCommand

func NewAskCommand(p *plugin) Commander

func NewChangeCommand

func NewChangeCommand(p *plugin) Commander

func NewListCommand

func NewListCommand(p *plugin) Commander

func NewRemoveCommand

func NewRemoveCommand(p *plugin) Commander

type Location

type Location struct {
	Name      string  `json:"name"`
	Latitude  float32 `json:"latitude"`
	Longitude float32 `json:"longitude"`
}

type LocationSorter

type LocationSorter []Location

func (LocationSorter) Len

func (s LocationSorter) Len() int

func (LocationSorter) Less

func (s LocationSorter) Less(i, j int) bool

func (LocationSorter) Swap

func (s LocationSorter) Swap(i, j int)

type LocationStore

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

func NewLocationStore

func NewLocationStore(path string) *LocationStore

func (*LocationStore) Del

func (s *LocationStore) Del(name string)

func (*LocationStore) Get

func (s *LocationStore) Get(name string) (Location, bool)

func (*LocationStore) Load

func (s *LocationStore) Load() error

func (*LocationStore) Locations

func (s *LocationStore) Locations() []Location

func (*LocationStore) Save

func (s *LocationStore) Save() error

func (*LocationStore) Set

func (s *LocationStore) Set(loc Location)

type PluginCloser

type PluginCloser interface {
	bot.Plugin
	io.Closer
}

func NewPlugin

func NewPlugin(appID string, path string) (PluginCloser, error)

Jump to

Keyboard shortcuts

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