Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Description string `json:"description"` Identifier string `json:"identifier"` Interfaces []Interface `json:"interfaces" yaml:"interfaces"` CreatedAt time.Time `json:"created_at" yaml:"created_at"` FirstSeenAt time.Time `json:"first_seen_at" yaml:"first_seen_at"` LastSeenAt time.Time `json:"last_seen_at" yaml:"last_seen_at"` Present bool `json:"present" yaml:"present"` Properties map[string]string `json:"properties,omitempty" yaml:"properties,omitempty"` Status Status `json:"status" yaml:"status"` UpdatedAt time.Time `json:"updated_at" yaml:"updated_at"` }
Device represents a single device that can be tracked.
type DeviceAdded ¶
type DevicePresenceUpdated ¶
type DeviceRemoved ¶
type DeviceRemoved struct {
Identifier string `json:"identifier"`
}
type DeviceUpdated ¶
type Event ¶
type Event struct { Type EventType `json:"type"` Data json.RawMessage `json:"data"` }
type EventType ¶
type EventType uint
func (EventType) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string
func (*EventType) UnmarshalJSON ¶
UnmarshalJSON unmarshals a quoted json string to the enum value
type Interface ¶
type Interface struct { Type InterfaceType MACAddress string IPv4Address string }
Interface defines a physical/software interface that can be uniquely addressed
type InterfaceType ¶
type InterfaceType uint
InterfaceType defines the type of physical/software interface
const ( // InterfaceUnknown corresponds to an unsupported/unknown interface InterfaceUnknown InterfaceType = iota // InterfaceEthernet corresponds to an Ethernet interface InterfaceEthernet // InterfaceWifi corresponds to a WiFi interface InterfaceWifi // InterfaceBluetooth corresponds to a Bluetooth interface InterfaceBluetooth )
func (InterfaceType) MarshalJSON ¶
func (i InterfaceType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string
func (InterfaceType) MarshalYAML ¶
func (i InterfaceType) MarshalYAML() (interface{}, error)
MarshalYAML marshals the enum as yaml string
func (InterfaceType) String ¶
func (i InterfaceType) String() string
func (*InterfaceType) UnmarshalJSON ¶
func (i *InterfaceType) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a quoted json string to the enum value
func (*InterfaceType) UnmarshalYAML ¶
func (i *InterfaceType) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals a yaml string to the enum value
type Status ¶
type Status uint
Status represents the various states a device can be in.
const ( // StatusUndefined is the default initialised device status. StatusUndefined Status = iota // StatusDiscovered is the initial state given to a device that was found // by a tracker scan operation for the first time. StatusDiscovered // StatusIgnored is the state given to a device that should not be tracked. StatusIgnored // StatusTracked is the state given to a device that should be watched. StatusTracked )
func (Status) MarshalJSON ¶
MarshalJSON marshals the enum as a quoted json string
func (Status) MarshalYAML ¶
MarshalYAML marshals the enum as yaml string
func (*Status) UnmarshalJSON ¶
UnmarshalJSON unmarshals a quoted json string to the enum value
func (*Status) UnmarshalYAML ¶
UnmarshalYAML unmarshals a yaml string to the enum value