commands

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2014 License: MIT Imports: 1 Imported by: 77

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	ID         uint             `json:"_id"`
	Action     string           `json:"_action"`
	ObjectType string           `json:"_type,omitempty"`
	Method     string           `json:"_method"`
	TargetID   uint             `json:"_target,omitempty"`
	Args       CommandArguments `json:"_args"`
}

func (Command) Send

func (c Command) Send(conn net.Conn)

type CommandArguments

type CommandArguments struct {
	RootUrl      string `json:"root_url,omitempty"`
	Title        string `json:"title,omitempty"`
	Size         SizeHW `json:"size,omitempty"`
	X            int    `json:"x,omitempty"`
	Y            int    `json:"y,omitempty"`
	CommandID    uint   `json:"command_id,omitempty"`
	Label        string `json:"label,omitempty"`
	MenuID       uint   `json:"menu_id,omitempty"` // this should never be 0 anyway
	WindowID     uint   `json:"window_id,omitempty"`
	SessionID    uint   `json:"session_id,omitempty"`
	GroupID      uint   `json:"group_id,omitempty"`
	Value        bool   `json:"value"`
	CookieStore  bool   `json:"cookie_store"`
	OffTheRecord bool   `json:"off_the_record"`
}

Covers all possible argument combinations. Makes use of omit empty to adapt to different use cases

type CommandResponse

type CommandResponse struct {
	Action string      `json:"_action,omitempty"`
	Error  string      `json:"_error,omitempty"`
	ID     uint        `json:"_id,omitempty"`
	Result ReplyResult `json:"_result,omitempty"`
	Event  EventResult `json:"_event,omitempty"`
}

type EventResult

type EventResult struct {
	CommandID  uint `json:"command_id,omitempty"`
	EventFlags int  `json:"event_flags,omitempty"`
}

type ReplyResult

type ReplyResult struct {
	TargetID uint `json:"_target,omitempty"`
}

type SizeHW

type SizeHW struct {
	Width  uint `json:"width,omitempty"`
	Height uint `json:"height,omitempty"`
}

Jump to

Keyboard shortcuts

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