message

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Deltas []Mapped `json:"deltas"`
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Append

func (b *Buffer) Append(m Mapped) *Buffer

func (*Buffer) Empty

func (b *Buffer) Empty() *Buffer

func (*Buffer) Lock

func (b *Buffer) Lock() *Buffer

func (Buffer) MarshalJSON

func (b Buffer) MarshalJSON() ([]byte, error)

func (*Buffer) Unlock

func (b *Buffer) Unlock() *Buffer

type Length

type Length struct {
	Overall   *float64 `json:"overall,omitempty"`
	Hull      *float64 `json:"hull,omitempty"`
	Waterline *float64 `json:"waterline,omitempty"`
}

type Mapped

type Mapped struct {
	Context string   `json:"context"` // indicates what the data is about
	Origin  string   `json:"origin"`  // indicates the creator of the data
	Updates []Update `json:"updates"`
}

func NewMapped

func NewMapped() *Mapped

func (*Mapped) AddUpdate

func (m *Mapped) AddUpdate(u *Update) *Mapped

func (*Mapped) WithContext

func (m *Mapped) WithContext(c string) *Mapped

func (*Mapped) WithOrigin

func (m *Mapped) WithOrigin(o string) *Mapped

type Position

type Position struct {
	Altitude  *float64 `json:"altitude,omitempty"`
	Latitude  *float64 `json:"latitude,omitempty"`
	Longitude *float64 `json:"longitude,omitempty"`
}

type Raw

type Raw struct {
	Collector string
	Timestamp time.Time `json:"timestamp"`
	Type      string    `json:"type"`
	Uuid      uuid.UUID `json:"uuid"`
	Value     []byte    `json:"value"`
}

func NewRaw

func NewRaw() *Raw

func (Raw) MarshalJSON

func (r Raw) MarshalJSON() ([]byte, error)

func (*Raw) UnmarshalJSON

func (r *Raw) UnmarshalJSON(data []byte) error

func (*Raw) WithCollector

func (r *Raw) WithCollector(c string) *Raw

func (*Raw) WithType

func (r *Raw) WithType(t string) *Raw

func (*Raw) WithValue

func (r *Raw) WithValue(v []byte) *Raw

type RawExtraInfo

type RawExtraInfo interface{}

type Source

type Source struct {
	Label string `json:"label"`
	Type  string `json:"type"`
}

func NewSource

func NewSource() *Source

func (*Source) WithLabel

func (s *Source) WithLabel(l string) *Source

func (*Source) WithType

func (s *Source) WithType(t string) *Source

type Update

type Update struct {
	Source    Source    `json:"source"`
	Timestamp time.Time `json:"timestamp"`
	Values    []Value   `json:"values"`
}

func NewUpdate

func NewUpdate() *Update

func (*Update) AddValue

func (u *Update) AddValue(v *Value) *Update

func (*Update) WithSource

func (u *Update) WithSource(s *Source) *Update

func (*Update) WithTimestamp

func (u *Update) WithTimestamp(t time.Time) *Update

type Value

type Value struct {
	Path  string      `json:"path"`
	Uuid  uuid.UUID   `json:"uuid"`
	Value interface{} `json:"value"`
}

func NewValue

func NewValue() *Value

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(data []byte) error

func (*Value) WithPath

func (v *Value) WithPath(p string) *Value

func (*Value) WithUuid

func (v *Value) WithUuid(u uuid.UUID) *Value

func (*Value) WithValue

func (v *Value) WithValue(val interface{}) *Value

Jump to

Keyboard shortcuts

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