message

package
v0.1.87 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode added in v0.1.11

func Decode(input interface{}) (interface{}, error)

Types

type Alarm added in v0.1.10

type Alarm struct {
	State   *bool   `json:"state,omitempty"`
	Message *string `json:"message,omitempty"`
}

func (Alarm) Merge added in v0.1.23

func (left Alarm) Merge(right Merger) (Merger, error)

type Draft added in v0.1.47

type Draft struct {
	Current          *float64  `json:"current,omitempty"`
	CurrentPort      []float64 `json:"currentPort,omitempty"`
	CurrentStarboard []float64 `json:"currentStarboard,omitempty"`
}

func (Draft) Merge added in v0.1.47

func (left Draft) Merge(right Merger) (Merger, error)

type Length

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

func (Length) Merge added in v0.1.23

func (left Length) Merge(right Merger) (Merger, error)

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) Equals added in v0.1.18

func (m Mapped) Equals(other Mapped) bool

func (Mapped) ToSingleValueMapped added in v0.1.20

func (m Mapped) ToSingleValueMapped() []SingleValueMapped

func (*Mapped) WithContext

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

func (*Mapped) WithOrigin

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

type Merger added in v0.1.23

type Merger interface {
	// Merges left with right, if both left and right have the same property the value of the right property will be returned
	Merge(right Merger) (Merger, error)
}

type Position

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

func (Position) Merge added in v0.1.23

func (left Position) Merge(right Merger) (Merger, error)

type Raw

type Raw struct {
	Connector string    `json:"connector"`
	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) Equals added in v0.1.36

func (r Raw) Equals(other Raw) bool

func (Raw) MarshalJSON

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

func (*Raw) UnmarshalJSON

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

func (*Raw) WithConnector added in v0.1.49

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

func (*Raw) WithType

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

func (*Raw) WithValue

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

type SingleValueMapped added in v0.1.20

type SingleValueMapped struct {
	Context   string      `json:"context"`
	Origin    string      `json:"origin"`
	Source    Source      `json:"source"`
	Timestamp time.Time   `json:"timestamp"`
	Path      string      `json:"path"`
	Value     interface{} `json:"value"`
}

func NewSingleValueMapped added in v0.1.20

func NewSingleValueMapped() *SingleValueMapped

func (SingleValueMapped) Equals added in v0.1.20

func (s SingleValueMapped) Equals(other SingleValueMapped) bool

func (SingleValueMapped) Merge added in v0.1.23

Merges left with right, if both left and right have the same property the value of the right property will be returned

func (SingleValueMapped) ToMapped added in v0.1.20

func (s SingleValueMapped) ToMapped() Mapped

func (*SingleValueMapped) UnmarshalJSON added in v0.1.23

func (s *SingleValueMapped) UnmarshalJSON(data []byte) error

type Source

type Source struct {
	Label        string    `json:"label"`
	Type         string    `json:"type"`
	Uuid         uuid.UUID `json:"uuid"`
	TransferUuid uuid.UUID `json:"transferUuid"`
}

func NewSource

func NewSource() *Source

func (*Source) WithLabel

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

func (*Source) WithTransferUuid added in v0.1.51

func (s *Source) WithTransferUuid(u uuid.UUID) *Source

func (*Source) WithType

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

func (*Source) WithUuid added in v0.1.23

func (s *Source) WithUuid(u uuid.UUID) *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) Equals added in v0.1.18

func (u Update) Equals(other Update) bool

func (*Update) GetValueByPath added in v0.1.40

func (u *Update) GetValueByPath(p string) *Value

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"`
	Value interface{} `json:"value"`
}

func NewValue

func NewValue() *Value

func (Value) Equals added in v0.1.18

func (v Value) Equals(other Value) bool

func (*Value) UnmarshalJSON

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

func (*Value) WithPath

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

func (*Value) WithValue

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

type VesselInfo added in v0.1.23

type VesselInfo struct {
	MMSI *string `json:"mmsi,omitempty"`
	Name *string `json:"name,omitempty"`
}

func (VesselInfo) Merge added in v0.1.23

func (left VesselInfo) Merge(right Merger) (Merger, error)

type VesselType added in v0.1.25

type VesselType struct {
	Id   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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