Documentation ¶
Overview ¶
Implements an SSE broker for HTML5 Clients
Index ¶
- Constants
- type Broker
- type Camera
- type Emitter
- type EmitterID
- type Igniter
- func (i *Igniter) Emit(v interface{})
- func (i *Igniter) Fire() error
- func (i *Igniter) GetFirstRecorded() *IgniterState
- func (i *Igniter) GetRecordedData() map[*zip.FileHeader][]byte
- func (i *Igniter) GetState() IgniterState
- func (i *Igniter) IsFiring() bool
- func (i *Igniter) IsReady() bool
- func (i *Igniter) ResetRecording()
- func (i *Igniter) StartRecording()
- func (i *Igniter) StopRecording()
- type IgniterState
- type Mission
- type Recordable
- type Sample
- type Scale
- func (s *Scale) Calibrate(mass int) error
- func (s *Scale) Close()
- func (s *Scale) GetRecordedData() map[*zip.FileHeader][]byte
- func (s *Scale) Read() Sample
- func (s *Scale) ResetRecording()
- func (s *Scale) RollingAverage(duration time.Duration) Sample
- func (s *Scale) StartRecording()
- func (s *Scale) StopRecording()
- func (s *Scale) Tare()
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { // Channel into which message are pushed to be broadcast out to attached clients. Outgoing chan string // contains filtered or unexported fields }
type Camera ¶
type Camera struct { Emitter `json:"-"` sync.Mutex `json:"-"` Recordable `json:"-"` DeviceName string Initialized bool Recording bool // contains filtered or unexported fields }
Representation of Camera state.
swagger:model
func (*Camera) GetRecordedData ¶
func (c *Camera) GetRecordedData() map[*zip.FileHeader][]byte
func (*Camera) ResetRecording ¶
func (c *Camera) ResetRecording()
func (*Camera) StartRecording ¶
func (c *Camera) StartRecording()
func (*Camera) StopRecording ¶
func (c *Camera) StopRecording()
type Emitter ¶
type Emitter struct { EmitterID // contains filtered or unexported fields }
func (*Emitter) AddListener ¶
func (*Emitter) RemoveListener ¶
type Igniter ¶
type Igniter struct { TestPin gpio.PinIO `json:"-"` FirePin gpio.PinIO `json:"-"` Recording bool Emitter `json:"-"` Recordable `json:"-"` sync.Mutex `json:"-"` // contains filtered or unexported fields }
How we communicate with the Igniter
func (*Igniter) GetFirstRecorded ¶
func (i *Igniter) GetFirstRecorded() *IgniterState
func (*Igniter) GetRecordedData ¶
func (i *Igniter) GetRecordedData() map[*zip.FileHeader][]byte
func (*Igniter) GetState ¶
func (i *Igniter) GetState() IgniterState
func (*Igniter) ResetRecording ¶
func (i *Igniter) ResetRecording()
func (*Igniter) StartRecording ¶
func (i *Igniter) StartRecording()
func (*Igniter) StopRecording ¶
func (i *Igniter) StopRecording()
type Mission ¶
type Recordable ¶
type Recordable interface { StartRecording() StopRecording() ResetRecording() GetRecordedData() map[*zip.FileHeader][]byte }
type Sample ¶
type Sample struct { Initialized bool Calibrated bool Recording bool ZeroOffset int Adjust float64 Timestamp int64 Volt0 uint32 Volt0Mass *float64 Volt1 uint32 Volt1Mass *float64 }
Representation of a Scale Measurement
swagger:model
func (*Sample) CalculateMass ¶
func (s *Sample) CalculateMass()
type Scale ¶
type Scale struct { TriggerC <-chan time.Time `json:"-"'` Emitter `json:"-"` sync.Mutex `json:"-"` Recordable `json:"-"` Device string Trigger string Initialized bool Calibrated bool Recording bool // Zero Offset (tare) threshold ZeroOffset int // Known measured values. Measured map[int]int // The adjustment scale value. Adjust float64 // contains filtered or unexported fields }
Representation of Scale state.
swagger:model
func (*Scale) GetRecordedData ¶
func (s *Scale) GetRecordedData() map[*zip.FileHeader][]byte
func (*Scale) ResetRecording ¶
func (s *Scale) ResetRecording()
func (*Scale) StartRecording ¶
func (s *Scale) StartRecording()
func (*Scale) StopRecording ¶
func (s *Scale) StopRecording()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.