dispatcher

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2015 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Index

Constants

View Source
const ChanQueueLength = 100

ChanQueueLength buffered channel length

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	InChan  chan interface{}
	OutChan chan interface{}
	// contains filtered or unexported fields
}

Connection : basic interface representing a connection to the dispatcher

func NewConnection

func NewConnection() *Connection

NewConnection creates a new dispatcher connection

func (*Connection) Close

func (connection *Connection) Close()

Close closes the connection, possible issues...

type Dispatcher

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

Dispatcher main dispatcher class

func NewDispatcher

func NewDispatcher() *Dispatcher

NewDispatcher creates a dispatcher

func (*Dispatcher) AddConnection

func (dispatcher *Dispatcher) AddConnection(connection *Connection)

AddConnection adds a connection to the dispatcher

func (*Dispatcher) Start

func (dispatcher *Dispatcher) Start()

Start starts the dispatcher

type Object

type Object map[string]interface{}

Object native representation of a UAVPacket, just a map

type Request

type Request struct {
	ObjectID   uint32 `json:"objectId"`
	InstanceID uint16 `json:"instanceId"`
}

Request is the packet that requests a common data, is forwarded to the owner of a definition (the one that sent the definition)

type Subscription

type Subscription struct {
	ObjectID uint32 `json:"objectId"`
}

Subscription adds an objectID to the subscriptions of the sending connection

type Unsubscription

type Unsubscription struct {
	ObjectID uint32 `json:"objectId"`
}

Unsubscription removes an objectID from the subscriptions of the sending connection

type Update

type Update struct {
	ObjectID   uint32 `json:"objectId"`
	InstanceID uint16 `json:"instanceId"`
	Data       Object `json:"data"`
}

Update is the UAVTalk protocol packet, encapsulates a common in the field Data

Jump to

Keyboard shortcuts

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