model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conductivity

type Conductivity uint16

func (Conductivity) MarshalJSON

func (c Conductivity) MarshalJSON() ([]byte, error)

func (Conductivity) String

func (c Conductivity) String() string

func (Conductivity) Value

func (c Conductivity) Value() float64

type Firmware

type Firmware struct {
	Version string `json:"version"`
	Battery uint8  `json:"battery"`
}

func (*Firmware) UnmarshalBinary

func (f *Firmware) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Measurement

type Measurement struct {
	Temperature  *Temperature  `json:"temperature"`
	Moisture     *uint8        `json:"moisture"`
	Brightness   *uint16       `json:"brightness"`
	Conductivity *Conductivity `json:"conductivity"`
}

func (*Measurement) LogWith

func (m *Measurement) LogWith(l log.Logger) log.Logger

func (*Measurement) UnmarshalBinary

func (m *Measurement) UnmarshalBinary(r io.Reader) error

type Result

type Result struct {
	Name    string `json:"name,omitempty"`
	Address string `json:"address,omitempty"`

	Timestamp   *time.Time   `json:"timestamp,omitempty"`
	Firmware    *Firmware    `json:"firmware,omitempty"`
	Measurement *Measurement `json:"measurement,omitempty"`
}

type Temperature

type Temperature int16

func (*Temperature) MarshalJSON

func (t *Temperature) MarshalJSON() ([]byte, error)

func (Temperature) String

func (t Temperature) String() string

func (Temperature) Value

func (t Temperature) Value() float64

Jump to

Keyboard shortcuts

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