bg

package
v0.0.0-...-a16d91a Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelPublisher

type ChannelPublisher interface {
	PublishReader(string, io.Reader) error
}

ChannelPublisher defines an interface that sends an io.Reader interface to a consumer

type ChannelStore

type ChannelStore map[string]chan io.Reader

ChannelStore defines a map of channel names to the channel that will send/receivers readers

func (*ChannelStore) PublishReader

func (s *ChannelStore) PublishReader(name string, reader io.Reader) error

PublishReader publishes an instance of an io.Reader to a channel it owns.

type DeviceChannels

type DeviceChannels struct {
	Commands      ReadStream
	Feedback      WriteStream
	Registrations device.RegistrationStream
}

DeviceChannels is a convenience structure containing a ReadStream, WriteStream and RegistrationStream

type DeviceControlProcessor

type DeviceControlProcessor struct {
	*logging.Logger
	// contains filtered or unexported fields
}

The DeviceControlProcessor is used by the server to maintain the pool of websocket connections, register new device connections w/ the index and relay any messages along to the device.

func NewDeviceControlProcessor

func NewDeviceControlProcessor(c *DeviceChannels, s device.Index, k *security.ServerKey) *DeviceControlProcessor

NewDeviceControlProcessor returns a new DeviceControlProcessor

func (*DeviceControlProcessor) Start

func (processor *DeviceControlProcessor) Start(wg *sync.WaitGroup, stop KillSwitch)

Start will continuously loop over registration & command channels delegating to private methods as necessary.

type DeviceFeedbackProcessor

type DeviceFeedbackProcessor struct {
	*logging.Logger
	// contains filtered or unexported fields
}

DeviceFeedbackProcessor is responsible for receiving from the device feedback stream

func NewDeviceFeedbackProcessor

func NewDeviceFeedbackProcessor(feedback ReadStream) *DeviceFeedbackProcessor

NewDeviceFeedbackProcessor is responsible for receiving from the device feedback stream

func (*DeviceFeedbackProcessor) Start

func (processor *DeviceFeedbackProcessor) Start(wg *sync.WaitGroup, stop KillSwitch)

Start is the Processor#Start implementation

type KillSwitch

type KillSwitch chan struct{}

KillSwitch is a channel of empty structs

type Processor

type Processor interface {
	Start(*sync.WaitGroup, KillSwitch)
}

Processor is an interface that defines a background-task with async safeguards

type ReadStream

type ReadStream <-chan io.Reader

ReadStream defines a receive-only channel for io.Reader types

type WriteStream

type WriteStream chan<- io.Reader

WriteStream defines a send-only channel for io.Reader types

Jump to

Keyboard shortcuts

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