commands

package
v0.0.0-...-df2b97c Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const BasicCommandTypeString = "basic"
View Source
const RANDOM_RANGE = 3
View Source
const SECONDS_TIMING = 6
View Source
const ToggleCommandTypeString = "toggle"

Variables

View Source
var CommandsAvailable map[int]DisplayCommand

Functions

func CancelScheduling

func CancelScheduling(sch *Scheduling)

func InitScheduling

func InitScheduling()

func ParseCommands

func ParseCommands(config JsonObject)

func RegisterCommandForPeriodicExecution

func RegisterCommandForPeriodicExecution(cmd DisplayCommand, secs int)

func ScheduleCommand

func ScheduleCommand(scheduling Scheduling) error

Types

type BasicCommand

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

func CreateBasicCommand

func CreateBasicCommand(data JsonObject) *BasicCommand

func (BasicCommand) Execute

func (cmd BasicCommand) Execute(parameter interface{}) string

type Command

type Command interface {
	Execute(parameter interface{}) string
}

type DisplayCommand

type DisplayCommand struct {
	ExecutableCommand       Command
	ID                      int
	Name, Description, Type string

	IsBasic  bool
	IsToggle bool

	AllowedUsers []string
}

type JsonObject

type JsonObject map[string]interface{}

type Scheduling

type Scheduling struct {
	ID          int
	StartDate   time.Time
	EndDate     time.Time
	StartTime   time.Time
	EndTime     time.Time
	Dynamic     bool
	CommandID   int
	ExecutedOn  bool
	ExecutedOff bool
}

func GetSchedulingById

func GetSchedulingById(id int) *Scheduling

func GetSchedulings

func GetSchedulings() []*Scheduling

type ToggleCommand

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

func CreateToggleCommand

func CreateToggleCommand(data JsonObject) *ToggleCommand

func (ToggleCommand) Execute

func (cmd ToggleCommand) Execute(parameter interface{}) string

Jump to

Keyboard shortcuts

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