Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SoundEventMessageType is for working with sound event messages SoundEventMessageType = "SOUND" // MotionEventMessageType is for working with motion event messages MotionEventMessageType = "MOTION" // TemperatureEventMessageType is for working with temperature event messages TemperatureEventMessageType = "TEMPERATURE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
// TODO: Determin format for ReadAt, SeenAt, and DismissedAt
// TODO: unmarshall UpdatedAt and CreatedAt ISO8601 timestamp into time.Time
// TODO: enumerate possible Data interface structures
Id int `json:"id"`
BabyUid string `json:"baby_uid"`
UserId int `json:"user_id"`
Type string `json:"type"`
Time UnixTime `json:"time"`
ReadAt string `json:"read_at"`
SeenAt string `json:"seen_at"`
DismissedAt string `json:"dismissed_at"`
UpdatedAt string `json:"updated_at"`
CreatedAt string `json:"created_at"`
Data interface{} `json:"data"`
}
Message - message info (matching the Nanit API)
func FilterMessages ¶
FilterMessages allows a slice (?) of Messages to be filtered by an aribitrary function that returns true or false for each element, indicating whether it should be included in the filtered set or not
type UnixTime ¶
func (UnixTime) MarshalJSON ¶
MarshalJSON is used to convert the timestamp to JSON
func (UnixTime) Unix ¶
Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t.
func (*UnixTime) UnmarshalJSON ¶
UnmarshalJSON is used to convert the timestamp from JSON
Click to show internal directories.
Click to hide internal directories.