Documentation
¶
Overview ¶
Package devices implements operations for device data manipulation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶ added in v0.5.0
func Add(ctx context.Context, args AddDeviceRequest) (string, error)
Add adds new Device to given storage with default options. Returns assigned ID if there is no error.
func PublicSlice ¶
func PublicSlice(d []models.Device) []models.DevicePublicData
PublicSlice returns new slice with only public device data, created from given slice containing full device data.
Types ¶
type AddDeviceRequest ¶ added in v0.5.0
type AddDeviceRequest struct { // OwnerID is id of user that owns new device. OwnerID string // Owner is nickname of new device owner. Owner string // Tag is a name for new device. Tag string // MAC is raw hardress address of the device. // // There is no need to verify MAC before passing to // AddDeviceRequest, because it will be verified during // adding to storage by Add function. MAC string // Storage for devices. Storage storage.Devices }
AddDeviceRequest holds arguments for Add service method.
Click to show internal directories.
Click to hide internal directories.