command

package
v0.0.0-...-af04dbd Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const RemoteComponentName = "zug_ins_nirgendwo_2019"

Variables

This section is empty.

Functions

func Playback

func Playback(ip string, index int, playlist []string, delays []float64)

Playback sends the provided index and playlist to an attached media_player

Types

type ACK

type ACK struct {
	Command *Command `json:"command"`
	Success bool     `json:"success"`
	Value   string   `json:"value"`
}

ACK is used as simple ACK for received commands

func Send

func Send(cmd *Command, ip string, responseBuffer []byte) *ACK

Send will send the provided command via tcp to the provided ip-address. return: an ACK for the Command

type Command

type Command struct {
	CommandID int           `json:"id"`
	Command   string        `json:"cmd"`
	Arguments []interface{} `json:"arg"`
}

Command realizes a simple RPC interface

func (*Command) String

func (cmd *Command) String() string

type QueueWorker

type QueueWorker struct {
	TCPAddress string
	Commands   chan *Command
	Results    chan *ACK
}

QueueWorker pulls commands from a channel, sends them via tcp and pushes results back to the results channel

func NewQueueWorker

func NewQueueWorker(tcpAddress string) *QueueWorker

NewQueueWorker creates a new instance

Jump to

Keyboard shortcuts

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