commander

package
v0.0.0-...-24dab48 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: MIT, MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FailureError = Xrror("command failure: %s").Out
	SyntaxError  = Xrror("received message `%s`, but syntax was incorrect: %s").Out
	UnknownError = Xrror("received unknown message of type `%s`: %s").Out
	LengthError  = Xrror("inappropriate length message: `%d : %s`, message must be longer than 1 word and shorter than 15").Out
)

Functions

func Xrror

func Xrror(err string) *commanderError

Types

type Command

type Command interface {
	Primary() string
	Selector() string
	Opts() [][]string
	Raw() string
	Process(Data) (Response, string, error)
}

func NewCommand

func NewCommand(cmd []byte) Command

type Commander

type Commander interface {
	Listen(*net.UnixListener, Data)
	Process([]byte, Data) Response
}

func New

func New(comm chan string) Commander

type Data

type Data interface {
	settings.Settings
	handler.Handler
	rules.Ruler
	Tree() *branch.Branch
	Monitors() []monitors.Monitor
	Desktops() []desktops.Desktop
	Clients() []clients.Client
}

type Response

type Response []byte

Jump to

Keyboard shortcuts

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