Documentation
¶
Index ¶
- type AddressableClient
- type AddressableRestClient
- func (a *AddressableRestClient) Add(addr *models.Addressable, ctx context.Context) (string, error)
- func (a *AddressableRestClient) Addressable(id string, ctx context.Context) (models.Addressable, error)
- func (a *AddressableRestClient) AddressableForName(name string, ctx context.Context) (models.Addressable, error)
- func (a *AddressableRestClient) Delete(id string, ctx context.Context) error
- func (a *AddressableRestClient) Update(addr models.Addressable, ctx context.Context) error
- type CommandClient
- type CommandRestClient
- func (c *CommandRestClient) Add(com *models.Command, ctx context.Context) (string, error)
- func (c *CommandRestClient) Command(id string, ctx context.Context) (models.Command, error)
- func (c *CommandRestClient) Commands(ctx context.Context) ([]models.Command, error)
- func (c *CommandRestClient) CommandsForName(name string, ctx context.Context) ([]models.Command, error)
- func (c *CommandRestClient) Delete(id string, ctx context.Context) error
- func (c *CommandRestClient) Update(com models.Command, ctx context.Context) error
- type DeviceClient
- type DeviceProfileClient
- type DeviceProfileRestClient
- func (dpc *DeviceProfileRestClient) Add(dp *models.DeviceProfile, ctx context.Context) (string, error)
- func (dpc *DeviceProfileRestClient) Delete(id string, ctx context.Context) error
- func (dpc *DeviceProfileRestClient) DeleteByName(name string, ctx context.Context) error
- func (dpc *DeviceProfileRestClient) DeviceProfile(id string, ctx context.Context) (models.DeviceProfile, error)
- func (dpc *DeviceProfileRestClient) DeviceProfileForName(name string, ctx context.Context) (models.DeviceProfile, error)
- func (dpc *DeviceProfileRestClient) DeviceProfiles(ctx context.Context) ([]models.DeviceProfile, error)
- func (dpc *DeviceProfileRestClient) Update(dp models.DeviceProfile, ctx context.Context) error
- func (dpc *DeviceProfileRestClient) Upload(yamlString string, ctx context.Context) (string, error)
- func (dpc *DeviceProfileRestClient) UploadFile(yamlFilePath string, ctx context.Context) (string, error)
- type DeviceRestClient
- func (d *DeviceRestClient) Add(dev *models.Device, ctx context.Context) (string, error)
- func (d *DeviceRestClient) CheckForDevice(token string, ctx context.Context) (models.Device, error)
- func (d *DeviceRestClient) Delete(id string, ctx context.Context) error
- func (d *DeviceRestClient) DeleteByName(name string, ctx context.Context) error
- func (d *DeviceRestClient) Device(id string, ctx context.Context) (models.Device, error)
- func (d *DeviceRestClient) DeviceForName(name string, ctx context.Context) (models.Device, error)
- func (d *DeviceRestClient) Devices(ctx context.Context) ([]models.Device, error)
- func (d *DeviceRestClient) DevicesByLabel(label string, ctx context.Context) ([]models.Device, error)
- func (d *DeviceRestClient) DevicesForProfile(profileId string, ctx context.Context) ([]models.Device, error)
- func (d *DeviceRestClient) DevicesForProfileByName(profileName string, ctx context.Context) ([]models.Device, error)
- func (d *DeviceRestClient) DevicesForService(serviceId string, ctx context.Context) ([]models.Device, error)
- func (d *DeviceRestClient) DevicesForServiceByName(serviceName string, ctx context.Context) ([]models.Device, error)
- func (d *DeviceRestClient) Update(dev models.Device, ctx context.Context) error
- func (d *DeviceRestClient) UpdateAdminState(id string, adminState string, ctx context.Context) error
- func (d *DeviceRestClient) UpdateAdminStateByName(name string, adminState string, ctx context.Context) error
- func (d *DeviceRestClient) UpdateLastConnected(id string, time int64, ctx context.Context) error
- func (d *DeviceRestClient) UpdateLastConnectedByName(name string, time int64, ctx context.Context) error
- func (d *DeviceRestClient) UpdateLastReported(id string, time int64, ctx context.Context) error
- func (d *DeviceRestClient) UpdateLastReportedByName(name string, time int64, ctx context.Context) error
- func (d *DeviceRestClient) UpdateOpState(id string, opState string, ctx context.Context) error
- func (d *DeviceRestClient) UpdateOpStateByName(name string, opState string, ctx context.Context) error
- type DeviceServiceClient
- type DeviceServiceRestClient
- func (s *DeviceServiceRestClient) Add(ds *models.DeviceService, ctx context.Context) (string, error)
- func (s *DeviceServiceRestClient) DeviceServiceForName(name string, ctx context.Context) (models.DeviceService, error)
- func (s *DeviceServiceRestClient) UpdateLastConnected(id string, time int64, ctx context.Context) error
- func (s *DeviceServiceRestClient) UpdateLastReported(id string, time int64, ctx context.Context) error
- type ProvisionWatcherClient
- type ProvisionWatcherRestClient
- func (pw *ProvisionWatcherRestClient) Add(dev *models.ProvisionWatcher, ctx context.Context) (string, error)
- func (pw *ProvisionWatcherRestClient) Delete(id string, ctx context.Context) error
- func (pw *ProvisionWatcherRestClient) ProvisionWatcher(id string, ctx context.Context) (models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) ProvisionWatcherForName(name string, ctx context.Context) (models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) ProvisionWatchers(ctx context.Context) ([]models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) ProvisionWatchersForProfile(profileId string, ctx context.Context) ([]models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) ProvisionWatchersForProfileByName(profileName string, ctx context.Context) ([]models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) ProvisionWatchersForService(serviceId string, ctx context.Context) ([]models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) ProvisionWatchersForServiceByName(serviceName string, ctx context.Context) ([]models.ProvisionWatcher, error)
- func (pw *ProvisionWatcherRestClient) Update(dev models.ProvisionWatcher, ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressableClient ¶
type AddressableClient interface { Add(addr *models.Addressable, ctx context.Context) (string, error) Addressable(id string, ctx context.Context) (models.Addressable, error) AddressableForName(name string, ctx context.Context) (models.Addressable, error) Update(addr models.Addressable, ctx context.Context) error Delete(id string, ctx context.Context) error }
Addressable client for interacting with the addressable section of metadata
func NewAddressableClient ¶
func NewAddressableClient(url string) AddressableClient
Return an instance of AddressableClient
type AddressableRestClient ¶
type AddressableRestClient struct {
// contains filtered or unexported fields
}
func (*AddressableRestClient) Add ¶
func (a *AddressableRestClient) Add(addr *models.Addressable, ctx context.Context) (string, error)
Add an addressable - handle error codes Returns the ID of the addressable and an error
func (*AddressableRestClient) Addressable ¶
func (a *AddressableRestClient) Addressable(id string, ctx context.Context) (models.Addressable, error)
Get an addressable by id
func (*AddressableRestClient) AddressableForName ¶
func (a *AddressableRestClient) AddressableForName(name string, ctx context.Context) (models.Addressable, error)
Get the addressable by name
func (*AddressableRestClient) Delete ¶
func (a *AddressableRestClient) Delete(id string, ctx context.Context) error
Delete a addressable (specified by id)
func (*AddressableRestClient) Update ¶
func (a *AddressableRestClient) Update(addr models.Addressable, ctx context.Context) error
Update a addressable
type CommandClient ¶
type CommandClient interface { Add(com *models.Command, ctx context.Context) (string, error) Command(id string, ctx context.Context) (models.Command, error) Commands(ctx context.Context) ([]models.Command, error) CommandsForName(name string, ctx context.Context) ([]models.Command, error) Delete(id string, ctx context.Context) error Update(com models.Command, ctx context.Context) error }
Command client for interacting with the command section of metadata
func NewCommandClient ¶
func NewCommandClient(url string) CommandClient
Return an instance of CommandClient
type CommandRestClient ¶
type CommandRestClient struct {
// contains filtered or unexported fields
}
func (*CommandRestClient) CommandsForName ¶
func (c *CommandRestClient) CommandsForName(name string, ctx context.Context) ([]models.Command, error)
Get a list of commands for a certain name
type DeviceClient ¶
type DeviceClient interface { Add(dev *models.Device, ctx context.Context) (string, error) Delete(id string, ctx context.Context) error DeleteByName(name string, ctx context.Context) error CheckForDevice(token string, ctx context.Context) (models.Device, error) Device(id string, ctx context.Context) (models.Device, error) DeviceForName(name string, ctx context.Context) (models.Device, error) Devices(ctx context.Context) ([]models.Device, error) DevicesByLabel(label string, ctx context.Context) ([]models.Device, error) DevicesForProfile(profileid string, ctx context.Context) ([]models.Device, error) DevicesForProfileByName(profileName string, ctx context.Context) ([]models.Device, error) DevicesForService(serviceid string, ctx context.Context) ([]models.Device, error) DevicesForServiceByName(serviceName string, ctx context.Context) ([]models.Device, error) Update(dev models.Device, ctx context.Context) error UpdateAdminState(id string, adminState string, ctx context.Context) error UpdateAdminStateByName(name string, adminState string, ctx context.Context) error UpdateLastConnected(id string, time int64, ctx context.Context) error UpdateLastConnectedByName(name string, time int64, ctx context.Context) error UpdateLastReported(id string, time int64, ctx context.Context) error UpdateLastReportedByName(name string, time int64, ctx context.Context) error UpdateOpState(id string, opState string, ctx context.Context) error UpdateOpStateByName(name string, opState string, ctx context.Context) error }
Device client for interacting with the device section of metadata
func NewDeviceClient ¶
func NewDeviceClient(url string) DeviceClient
Return an instance of DeviceClient
type DeviceProfileClient ¶
type DeviceProfileClient interface { Add(dp *models.DeviceProfile, ctx context.Context) (string, error) Delete(id string, ctx context.Context) error DeleteByName(name string, ctx context.Context) error DeviceProfile(id string, ctx context.Context) (models.DeviceProfile, error) DeviceProfiles(ctx context.Context) ([]models.DeviceProfile, error) DeviceProfileForName(name string, ctx context.Context) (models.DeviceProfile, error) Update(dp models.DeviceProfile, ctx context.Context) error Upload(yamlString string, ctx context.Context) (string, error) UploadFile(yamlFilePath string, ctx context.Context) (string, error) }
Device Profile client for interacting with the device profile section of metadata
func NewDeviceProfileClient ¶
func NewDeviceProfileClient(url string) DeviceProfileClient
Return an instance of DeviceProfileClient
type DeviceProfileRestClient ¶
type DeviceProfileRestClient struct {
// contains filtered or unexported fields
}
func (*DeviceProfileRestClient) Add ¶
func (dpc *DeviceProfileRestClient) Add(dp *models.DeviceProfile, ctx context.Context) (string, error)
Add a new device profile to metadata
func (*DeviceProfileRestClient) Delete ¶
func (dpc *DeviceProfileRestClient) Delete(id string, ctx context.Context) error
Delete a device profile (specified by id)
func (*DeviceProfileRestClient) DeleteByName ¶
func (dpc *DeviceProfileRestClient) DeleteByName(name string, ctx context.Context) error
Delete a device profile (specified by name)
func (*DeviceProfileRestClient) DeviceProfile ¶
func (dpc *DeviceProfileRestClient) DeviceProfile(id string, ctx context.Context) (models.DeviceProfile, error)
Get the device profile by id
func (*DeviceProfileRestClient) DeviceProfileForName ¶
func (dpc *DeviceProfileRestClient) DeviceProfileForName(name string, ctx context.Context) (models.DeviceProfile, error)
Get the device profile by name
func (*DeviceProfileRestClient) DeviceProfiles ¶
func (dpc *DeviceProfileRestClient) DeviceProfiles(ctx context.Context) ([]models.DeviceProfile, error)
Get a list of all devices
func (*DeviceProfileRestClient) Update ¶
func (dpc *DeviceProfileRestClient) Update(dp models.DeviceProfile, ctx context.Context) error
Update an existing device profile in metadata
func (*DeviceProfileRestClient) UploadFile ¶
type DeviceRestClient ¶
type DeviceRestClient struct {
// contains filtered or unexported fields
}
func (*DeviceRestClient) CheckForDevice ¶
Use the models.Event.Device property for the supplied token parameter. The above property is currently double-purposed and needs to be refactored. This call replaces the previous two calls necessary to lookup a device by id followed by name.
func (*DeviceRestClient) Delete ¶
func (d *DeviceRestClient) Delete(id string, ctx context.Context) error
Delete a device (specified by id)
func (*DeviceRestClient) DeleteByName ¶
func (d *DeviceRestClient) DeleteByName(name string, ctx context.Context) error
Delete a device (specified by name)
func (*DeviceRestClient) DeviceForName ¶
Get the device by name
func (*DeviceRestClient) DevicesByLabel ¶
func (d *DeviceRestClient) DevicesByLabel(label string, ctx context.Context) ([]models.Device, error)
Get the device by label
func (*DeviceRestClient) DevicesForProfile ¶
func (d *DeviceRestClient) DevicesForProfile(profileId string, ctx context.Context) ([]models.Device, error)
Get the devices for a profile
func (*DeviceRestClient) DevicesForProfileByName ¶
func (d *DeviceRestClient) DevicesForProfileByName(profileName string, ctx context.Context) ([]models.Device, error)
Get the devices for a profile (by name)
func (*DeviceRestClient) DevicesForService ¶
func (d *DeviceRestClient) DevicesForService(serviceId string, ctx context.Context) ([]models.Device, error)
Get the devices that are on a service
func (*DeviceRestClient) DevicesForServiceByName ¶
func (d *DeviceRestClient) DevicesForServiceByName(serviceName string, ctx context.Context) ([]models.Device, error)
Get the devices that are on a service(by name)
func (*DeviceRestClient) UpdateAdminState ¶
func (d *DeviceRestClient) UpdateAdminState(id string, adminState string, ctx context.Context) error
Update the adminState value for a device (specified by id)
func (*DeviceRestClient) UpdateAdminStateByName ¶
func (d *DeviceRestClient) UpdateAdminStateByName(name string, adminState string, ctx context.Context) error
Update the adminState value for a device (specified by name)
func (*DeviceRestClient) UpdateLastConnected ¶
Update the lastConnected value for a device (specified by id)
func (*DeviceRestClient) UpdateLastConnectedByName ¶
func (d *DeviceRestClient) UpdateLastConnectedByName(name string, time int64, ctx context.Context) error
Update the lastConnected value for a device (specified by name)
func (*DeviceRestClient) UpdateLastReported ¶
Update the lastReported value for a device (specified by id)
func (*DeviceRestClient) UpdateLastReportedByName ¶
func (d *DeviceRestClient) UpdateLastReportedByName(name string, time int64, ctx context.Context) error
Update the lastReported value for a device (specified by name)
func (*DeviceRestClient) UpdateOpState ¶
Update the opState value for a device (specified by id)
func (*DeviceRestClient) UpdateOpStateByName ¶
func (d *DeviceRestClient) UpdateOpStateByName(name string, opState string, ctx context.Context) error
Update the opState value for a device (specified by name)
type DeviceServiceClient ¶
type DeviceServiceClient interface { Add(ds *models.DeviceService, ctx context.Context) (string, error) DeviceServiceForName(name string, ctx context.Context) (models.DeviceService, error) UpdateLastConnected(id string, time int64, ctx context.Context) error UpdateLastReported(id string, time int64, ctx context.Context) error }
Service client for interacting with the device service section of metadata
func NewDeviceServiceClient ¶
func NewDeviceServiceClient(url string) DeviceServiceClient
Return an instance of DeviceServiceClient
type DeviceServiceRestClient ¶
type DeviceServiceRestClient struct {
// contains filtered or unexported fields
}
func (*DeviceServiceRestClient) Add ¶
func (s *DeviceServiceRestClient) Add(ds *models.DeviceService, ctx context.Context) (string, error)
Add a new deviceservice
func (*DeviceServiceRestClient) DeviceServiceForName ¶
func (s *DeviceServiceRestClient) DeviceServiceForName(name string, ctx context.Context) (models.DeviceService, error)
Request deviceservice for specified name
func (*DeviceServiceRestClient) UpdateLastConnected ¶
func (s *DeviceServiceRestClient) UpdateLastConnected(id string, time int64, ctx context.Context) error
Update the last connected time for the device service
func (*DeviceServiceRestClient) UpdateLastReported ¶
func (s *DeviceServiceRestClient) UpdateLastReported(id string, time int64, ctx context.Context) error
Update the last reported time for the device service
type ProvisionWatcherClient ¶
type ProvisionWatcherClient interface { Add(dev *models.ProvisionWatcher, ctx context.Context) (string, error) Delete(id string, ctx context.Context) error ProvisionWatcher(id string, ctx context.Context) (models.ProvisionWatcher, error) ProvisionWatcherForName(name string, ctx context.Context) (models.ProvisionWatcher, error) ProvisionWatchers(ctx context.Context) ([]models.ProvisionWatcher, error) ProvisionWatchersForService(serviceId string, ctx context.Context) ([]models.ProvisionWatcher, error) ProvisionWatchersForServiceByName(serviceName string, ctx context.Context) ([]models.ProvisionWatcher, error) ProvisionWatchersForProfile(profileid string, ctx context.Context) ([]models.ProvisionWatcher, error) ProvisionWatchersForProfileByName(profileName string, ctx context.Context) ([]models.ProvisionWatcher, error) Update(dev models.ProvisionWatcher, ctx context.Context) error }
Provision Watcher client for interacting with the provision watcher section of metadata
func NewProvisionWatcherClient ¶
func NewProvisionWatcherClient(url string) ProvisionWatcherClient
Return an instance of ProvisionWatcherClient
type ProvisionWatcherRestClient ¶
type ProvisionWatcherRestClient struct {
// contains filtered or unexported fields
}
func (*ProvisionWatcherRestClient) Add ¶
func (pw *ProvisionWatcherRestClient) Add(dev *models.ProvisionWatcher, ctx context.Context) (string, error)
Add a provision watcher - handle error codes
func (*ProvisionWatcherRestClient) Delete ¶
func (pw *ProvisionWatcherRestClient) Delete(id string, ctx context.Context) error
Delete a provision watcher (specified by id)
func (*ProvisionWatcherRestClient) ProvisionWatcher ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatcher(id string, ctx context.Context) (models.ProvisionWatcher, error)
Get the provision watcher by id
func (*ProvisionWatcherRestClient) ProvisionWatcherForName ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatcherForName(name string, ctx context.Context) (models.ProvisionWatcher, error)
Get the provision watcher by name
func (*ProvisionWatcherRestClient) ProvisionWatchers ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatchers(ctx context.Context) ([]models.ProvisionWatcher, error)
Get a list of all provision watchers
func (*ProvisionWatcherRestClient) ProvisionWatchersForProfile ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatchersForProfile(profileId string, ctx context.Context) ([]models.ProvisionWatcher, error)
Get the provision watchers for a profile
func (*ProvisionWatcherRestClient) ProvisionWatchersForProfileByName ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatchersForProfileByName(profileName string, ctx context.Context) ([]models.ProvisionWatcher, error)
Get the provision watchers for a profile (by name)
func (*ProvisionWatcherRestClient) ProvisionWatchersForService ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatchersForService(serviceId string, ctx context.Context) ([]models.ProvisionWatcher, error)
Get the provision watchers that are on a service
func (*ProvisionWatcherRestClient) ProvisionWatchersForServiceByName ¶
func (pw *ProvisionWatcherRestClient) ProvisionWatchersForServiceByName(serviceName string, ctx context.Context) ([]models.ProvisionWatcher, error)
Get the provision watchers that are on a service(by name)
func (*ProvisionWatcherRestClient) Update ¶
func (pw *ProvisionWatcherRestClient) Update(dev models.ProvisionWatcher, ctx context.Context) error
Update a provision watcher - handle error codes