cmd

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MPL-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MsgNoUserFound   = "No user found with that name"
	MsgMoreUserFound = "Found more than one user with that name"
	MsgNoChanges     = "No changes made"
	MsgNoPermission  = "No permission to perform action"
	MsgInternalError = "Internal error prevented correct execution"
)

Messages

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

type Alias struct {
	Cmd
	Exe            string
	Arg            []string
	ArgExpected    int
	WithPriviledge gateway.AccessLevel
}

Alias abbreviates a command

func (*Alias) Execute

func (c *Alias) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Ban

type Ban struct {
	Cmd
	AccessProtect  gateway.AccessLevel
	AccessOverride gateway.AccessLevel
}

Ban user

func (*Ban) Execute

func (c *Ban) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Cmd

type Cmd struct {
	Disabled   bool
	Priviledge gateway.AccessLevel
}

Cmd is command base struct that implements Command.CanExecute

func (*Cmd) CanExecute

func (c *Cmd) CanExecute(t *gateway.Trigger) bool

CanExecute returns true if t.Access >= c.Access

type Commands

type Commands struct {
	Trigger    Trigger
	Whoami     Whoami
	Whois      Whois
	Settings   Settings
	List       List
	Say        Say
	SayPrivate SayPrivate
	Set        Set
	Kick       Kick
	Ban        Ban
	Unban      Unban
	Where      Where
	Ping       Ping
	Time       Time
	Uptime     Uptime
	Flip       Flip
	Roll       Roll
}

Commands listing

func (*Commands) AddTo

func (c *Commands) AddTo(g *goop.Goop) error

AddTo goop

type Flip

type Flip struct{ Cmd }

Flip a coin

func (*Flip) Execute

func (c *Flip) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Kick

type Kick struct {
	Cmd
	AccessProtect  gateway.AccessLevel
	AccessOverride gateway.AccessLevel
}

Kick user

func (*Kick) Execute

func (c *Kick) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type List

type List struct{ Cmd }

List users for a given access level

func (*List) Execute

func (c *List) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Ping

type Ping struct{ Cmd }

Ping user

func (*Ping) Execute

func (c *Ping) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Roll

type Roll struct{ Cmd }

Roll a dice

func (*Roll) Execute

func (c *Roll) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Say

type Say struct{ Cmd }

Say echoes input

func (*Say) Execute

func (c *Say) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type SayPrivate

type SayPrivate struct{ Cmd }

SayPrivate forwards input to user in private

func (*SayPrivate) Execute

func (c *SayPrivate) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Set

type Set struct {
	Cmd
	DefaultAccess gateway.AccessLevel
}

Set accesslevel for user

func (*Set) Execute

func (c *Set) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Settings

type Settings struct{ Cmd }

Settings management

func (*Settings) Execute

func (c *Settings) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Time

type Time struct {
	Cmd
	Format string
}

Time prints current time

func (*Time) Execute

func (c *Time) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Trigger

type Trigger struct{ Cmd }

Trigger outputs the command trigger for gateway

func (*Trigger) Execute

func (c *Trigger) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Unban

type Unban struct {
	Cmd
	AccessProtect  gateway.AccessLevel
	AccessOverride gateway.AccessLevel
}

Unban user

func (*Unban) Execute

func (c *Unban) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Uptime

type Uptime struct{ Cmd }

Uptime prints time since start

func (*Uptime) Execute

func (c *Uptime) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Where

type Where struct{ Cmd }

Where prints connected gateways

func (*Where) Execute

func (c *Where) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Whoami

type Whoami struct{ Cmd }

Whoami displays user info

func (*Whoami) Execute

func (c *Whoami) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

type Whois

type Whois struct{ Cmd }

Whois displays user info

func (*Whois) Execute

func (c *Whois) Execute(t *gateway.Trigger, gw gateway.Gateway, g *goop.Goop) error

Execute command

Jump to

Keyboard shortcuts

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