Documentation ¶
Index ¶
- func GenerateSDKIdentityCertificate(ctx context.Context, sign SignFunc, sdkDeviceID string) (tls.Certificate, []*x509.Certificate, error)
- func GenerateSDKManufacturerCertificate(ctx context.Context, sign SignFunc, id string) (tls.Certificate, []*x509.Certificate, error)
- func TokenFromOutgoingMD(ctx context.Context) (string, error)
- type ApplicationCallback
- type Client
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) CoreClient() *core.Client
- func (c *Client) CreateResource(ctx context.Context, deviceID string, href string, request interface{}, ...) error
- func (c *Client) DeleteDevice(ctx context.Context, deviceID string) bool
- func (c *Client) DeleteDevices(ctx context.Context, deviceIDFilter []string) []string
- func (c *Client) DeleteResource(ctx context.Context, deviceID string, href string, response interface{}, ...) error
- func (c *Client) DisownDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) FactoryReset(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) GetAllDeviceIDsFoundByIP() map[string]string
- func (c *Client) GetDevice(ctx context.Context, deviceID string, opts ...GetDeviceOption) (*core.Device, schema.ResourceLinks, error)
- func (c *Client) GetDeviceByIP(ctx context.Context, ip string) (*core.Device, schema.ResourceLinks, error)
- func (c *Client) GetDeviceByMulticast(ctx context.Context, deviceID string, opts ...GetDeviceOption) (*core.Device, schema.ResourceLinks, error)
- func (c *Client) GetDeviceDetailsByIP(ctx context.Context, ip string, opts ...GetDeviceByIPOption) (DeviceDetails, error)
- func (c *Client) GetDeviceDetailsByMulticast(ctx context.Context, deviceID string, opts ...GetDeviceOption) (DeviceDetails, error)
- func (c *Client) GetDevicesDetails(ctx context.Context, opts ...GetDevicesOption) (map[string]DeviceDetails, error)
- func (c *Client) GetDevicesWithHandler(ctx context.Context, handler core.DeviceMulticastHandler, ...) error
- func (c *Client) GetIdentityCACerts() ([]*x509.Certificate, error)
- func (c *Client) GetIdentityCertificate() (tls.Certificate, error)
- func (c *Client) GetResource(ctx context.Context, deviceID string, href string, response interface{}, ...) error
- func (c *Client) Initialization(ctx context.Context) (err error)
- func (c *Client) ObserveDeviceResources(ctx context.Context, deviceID string, ...) (string, error)
- func (c *Client) ObserveDevices(handler DevicesObservationHandler, opts ...ObserveDevicesOption) (string, error)
- func (c *Client) ObserveResource(ctx context.Context, deviceID string, href string, ...) (observationID string, _ error)
- func (c *Client) OffboardDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) OnboardDevice(ctx context.Context, ...) error
- func (c *Client) OwnDevice(ctx context.Context, deviceID string, opts ...OwnOption) (string, error)
- func (c *Client) Reboot(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
- func (c *Client) StopObservingDeviceResources(ctx context.Context, observationID string) (bool, error)
- func (c *Client) StopObservingDevices(observationID string) bool
- func (c *Client) StopObservingResource(ctx context.Context, observationID string) (bool, error)
- func (c *Client) UpdateResource(ctx context.Context, deviceID string, href string, request interface{}, ...) error
- type ClientConfig
- type ClientOptionFunc
- func WithCacheExpiration(cacheExpiration time.Duration) ClientOptionFunc
- func WithDialDTLS(dial core.DialDTLS) ClientOptionFunc
- func WithDialTCP(dial core.DialTCP) ClientOptionFunc
- func WithDialTLS(dial core.DialTLS) ClientOptionFunc
- func WithDialUDP(dial core.DialUDP) ClientOptionFunc
- func WithLogger(logger core.Logger) ClientOptionFunc
- func WithObserverConfig(observerConfig ObserverConfig) ClientOptionFunc
- func WithTLS(tlsConfig *core.TLSConfig) ClientOptionFunc
- type CodecOption
- type CommonCommandOption
- type Config
- type CreateOption
- type DeleteOption
- type DeviceCache
- func (c *DeviceCache) Close(ctx context.Context) error
- func (c *DeviceCache) GetDevice(deviceID string) (*core.Device, bool)
- func (c *DeviceCache) GetDeviceByFoundIP(ip string) *core.Device
- func (c *DeviceCache) GetDeviceExpiration(deviceID string) (time.Time, bool)
- func (c *DeviceCache) GetDevicesFoundByIP() map[string]string
- func (c *DeviceCache) LoadAndDeleteDevice(deviceID string) (*core.Device, bool)
- func (c *DeviceCache) LoadAndDeleteDevices(deviceIDFilter []string) []*core.Device
- func (c *DeviceCache) TryToChangeDeviceExpirationToDefault(deviceID string) bool
- func (c *DeviceCache) UpdateOrStoreDevice(device *core.Device) (*core.Device, bool)
- func (c *DeviceCache) UpdateOrStoreDeviceWithExpiration(device *core.Device) (*core.Device, bool)
- type DeviceDetails
- type DeviceOwner
- type DeviceOwnershipBackendConfig
- type DeviceOwnershipSDKConfig
- type DeviceResourcesObservationHandler
- type DevicesObservationEvent
- type DevicesObservationEvent_type
- type DevicesObservationHandler
- type DiscoveryConfigurationOption
- type GetDetailsFunc
- type GetDetailsOption
- type GetDeviceByIPOption
- type GetDeviceOption
- type GetDevicesOption
- type GetDevicesWithHandlerOption
- type GetOption
- type OTMType
- type ObserveDevicesOption
- type ObserveOption
- type ObserverConfig
- type OwnOption
- type OwnershipStatus
- type ResourceETagOption
- type ResourceInterfaceOption
- type ResourceQueryOption
- type ResourceTypesOption
- type SignFunc
- type Signer
- type UpdateOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSDKIdentityCertificate ¶
func GenerateSDKIdentityCertificate(ctx context.Context, sign SignFunc, sdkDeviceID string) (tls.Certificate, []*x509.Certificate, error)
func GenerateSDKManufacturerCertificate ¶
func GenerateSDKManufacturerCertificate(ctx context.Context, sign SignFunc, id string) (tls.Certificate, []*x509.Certificate, error)
Types ¶
type ApplicationCallback ¶
type ApplicationCallback = interface { GetRootCertificateAuthorities() ([]*x509.Certificate, error) GetManufacturerCertificateAuthorities() ([]*x509.Certificate, error) GetManufacturerCertificate() (tls.Certificate, error) }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client uses the underlying OCF local client.
func NewClient ¶
func NewClient( app ApplicationCallback, deviceOwner DeviceOwner, opt ...ClientOptionFunc, ) (*Client, error)
NewClient constructs a new local client.
func NewClientFromConfig ¶
NewClientFromConfig constructs a new local client from the proto configuration.
func (*Client) CoreClient ¶
func (*Client) CreateResource ¶
func (c *Client) CreateResource( ctx context.Context, deviceID string, href string, request interface{}, response interface{}, opts ...CreateOption, ) error
CreateResource creates the resource from the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) DeleteDevice ¶
DeleteDevice deletes the device from the cache.
func (*Client) DeleteDevices ¶
DeleteDevices deletes devices from the cache. If deviceIDFilter is empty, all devices are deleted.
func (*Client) DeleteResource ¶
func (c *Client) DeleteResource( ctx context.Context, deviceID string, href string, response interface{}, opts ...DeleteOption, ) error
DeleteResource deletes the resource from the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) DisownDevice ¶
func (c *Client) DisownDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
DisownDevice disowns a device. For unsecure device it calls factory reset. For secure device it disowns.
func (*Client) FactoryReset ¶
func (c *Client) FactoryReset(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
FactoryReset factory resets the device.
func (*Client) GetAllDeviceIDsFoundByIP ¶
func (*Client) GetDevice ¶
func (c *Client) GetDevice(ctx context.Context, deviceID string, opts ...GetDeviceOption, ) (*core.Device, schema.ResourceLinks, error)
GetDevice gets the device from the cache or via multicast or via IP address if was previously stored by GetDeviceByIP and updates device in the cache.
func (*Client) GetDeviceByIP ¶
func (c *Client) GetDeviceByIP( ctx context.Context, ip string, ) (*core.Device, schema.ResourceLinks, error)
GetDeviceByIP gets device by IP and store it to cache without expiration. To delete device, call DeleteDevices with the deviceID.
func (*Client) GetDeviceByMulticast ¶
func (c *Client) GetDeviceByMulticast(ctx context.Context, deviceID string, opts ...GetDeviceOption) (*core.Device, schema.ResourceLinks, error)
GetDeviceByMulticast gets device by multicast and store it to cache with expiration. When the device expiration time has expired, the device will be removed from cache. The device expiration time is prolonged by using the device.
func (*Client) GetDeviceDetailsByIP ¶
func (c *Client) GetDeviceDetailsByIP(ctx context.Context, ip string, opts ...GetDeviceByIPOption) (DeviceDetails, error)
GetDeviceDetailsByIP gets the device directly via IP address and multicast listen port 5683.
func (*Client) GetDeviceDetailsByMulticast ¶
func (c *Client) GetDeviceDetailsByMulticast(ctx context.Context, deviceID string, opts ...GetDeviceOption) (DeviceDetails, error)
func (*Client) GetDevicesDetails ¶ added in v2.0.2
func (c *Client) GetDevicesDetails( ctx context.Context, opts ...GetDevicesOption, ) (map[string]DeviceDetails, error)
GetDevicesDetails gets devices by multicast and devices found by ip. Each device are stored or refreshed in cache. When the device expiration time has expired, the device will be removed from cache. The device expiration time is prolonged by using the device.
func (*Client) GetDevicesWithHandler ¶
func (c *Client) GetDevicesWithHandler(ctx context.Context, handler core.DeviceMulticastHandler, opts ...GetDevicesWithHandlerOption) error
GetDevicesWithHandler discovers devices using a CoAP multicast request via UDP. Device resources can be queried in DeviceHandler using device.Client,
func (*Client) GetIdentityCACerts ¶
func (c *Client) GetIdentityCACerts() ([]*x509.Certificate, error)
func (*Client) GetIdentityCertificate ¶
func (c *Client) GetIdentityCertificate() (tls.Certificate, error)
GetIdentityCertificate returns certificate for connection
func (*Client) GetResource ¶
func (c *Client) GetResource( ctx context.Context, deviceID string, href string, response interface{}, opts ...GetOption, ) error
GetResource returns the device resource. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) Initialization ¶
Initialization initializes the client.
func (*Client) ObserveDeviceResources ¶
func (c *Client) ObserveDeviceResources(ctx context.Context, deviceID string, handler DeviceResourcesObservationHandler) (string, error)
ObserveDeviceResources starts observing links in the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) ObserveDevices ¶
func (c *Client) ObserveDevices(handler DevicesObservationHandler, opts ...ObserveDevicesOption) (string, error)
ObserveDevices method starts observing devices via multicast and added by IP in poll interval configured in observerPollingInterval.
func (*Client) ObserveResource ¶
func (c *Client) ObserveResource( ctx context.Context, deviceID string, href string, handler core.ObservationHandler, opts ...ObserveOption, ) (observationID string, _ error)
ObserveResource method starts observing the resource of the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) OffboardDevice ¶
func (c *Client) OffboardDevice(ctx context.Context, deviceID string, opts ...CommonCommandOption) error
OffboardDevice disconnects from the cloud and removes cloud configuration at the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) OnboardDevice ¶
func (c *Client) OnboardDevice( ctx context.Context, deviceID, authorizationProvider, cloudURL, authCode, cloudID string, opts ...CommonCommandOption, ) error
OnboardDevice connects device to the cloud. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) OwnDevice ¶
OwnDevice transfer ownership to the client and setup time at the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) StopObservingDeviceResources ¶
func (c *Client) StopObservingDeviceResources(ctx context.Context, observationID string) (bool, error)
StopObservingDeviceResources stops observing links in the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) StopObservingDevices ¶
StopObservingDevices method stops observing devices.
func (*Client) StopObservingResource ¶
StopObservingResource method stops observing the resource of the device. In the absence of a cached device, it is found through multicast and stored with an expiration time.
func (*Client) UpdateResource ¶
func (c *Client) UpdateResource( ctx context.Context, deviceID string, href string, request interface{}, response interface{}, opts ...UpdateOption, ) error
UpdateResource updates the device resource. In the absence of a cached device, it is found through multicast and stored with an expiration time.
type ClientConfig ¶ added in v2.1.0
type ClientConfig struct { CoreOptions []core.OptionFunc // CacheExpiration is a time after which the device entry in cache is invalidated. CacheExpiration time.Duration // Observer is a configuration of the devices observation. Observer ObserverConfig }
type ClientOptionFunc ¶ added in v2.1.0
type ClientOptionFunc func(ClientConfig) ClientConfig
func WithCacheExpiration ¶ added in v2.1.0
func WithCacheExpiration(cacheExpiration time.Duration) ClientOptionFunc
func WithDialDTLS ¶ added in v2.1.0
func WithDialDTLS(dial core.DialDTLS) ClientOptionFunc
func WithDialTCP ¶ added in v2.1.0
func WithDialTCP(dial core.DialTCP) ClientOptionFunc
func WithDialTLS ¶ added in v2.1.0
func WithDialTLS(dial core.DialTLS) ClientOptionFunc
func WithDialUDP ¶ added in v2.1.0
func WithDialUDP(dial core.DialUDP) ClientOptionFunc
func WithLogger ¶ added in v2.1.0
func WithLogger(logger core.Logger) ClientOptionFunc
func WithObserverConfig ¶ added in v2.1.0
func WithObserverConfig(observerConfig ObserverConfig) ClientOptionFunc
WithObserverConfig sets the observer config.
func WithTLS ¶ added in v2.1.0
func WithTLS(tlsConfig *core.TLSConfig) ClientOptionFunc
type CodecOption ¶
type CodecOption struct {
// contains filtered or unexported fields
}
func WithCodec ¶
func WithCodec(codec coap.Codec) CodecOption
type CommonCommandOption ¶
type CommonCommandOption = interface {
// contains filtered or unexported methods
}
CommonCommandOption option definition.
type Config ¶
type Config struct { DeviceCacheExpirationSeconds int64 ObserverPollingIntervalSeconds uint64 // 0 means 3 seconds ObserverFailureThreshold uint8 // 0 means 3 KeepAliveConnectionTimeoutSeconds uint64 // 0 means keepalive is disabled MaxMessageSize uint32 DisablePeerTCPSignalMessageCSMs bool DefaultTransferDurationSeconds uint64 // 0 means 15 seconds // specify one of: DeviceOwnershipSDK *DeviceOwnershipSDKConfig `yaml:",omitempty"` DeviceOwnershipBackend *DeviceOwnershipBackendConfig `yaml:",omitempty"` }
type CreateOption ¶
type CreateOption = interface {
// contains filtered or unexported methods
}
CreateOption option definition.
type DeleteOption ¶
type DeleteOption = interface {
// contains filtered or unexported methods
}
DeleteOption option definition.
type DeviceCache ¶
type DeviceCache struct {
// contains filtered or unexported fields
}
func NewDeviceCache ¶
func NewDeviceCache(deviceExpiration, pollInterval time.Duration, logger core.Logger) *DeviceCache
NewDeviceCache creates a new cache for devices. - deviceExpiration: default expiration time for the device in the cache, 0 means infinite. The device expiration is refreshed by getting or updating the device. - pollInterval: pool interval for cleaning expired devices from the cache - logger: logger for logging
func (*DeviceCache) GetDevice ¶
func (c *DeviceCache) GetDevice(deviceID string) (*core.Device, bool)
func (*DeviceCache) GetDeviceByFoundIP ¶
func (c *DeviceCache) GetDeviceByFoundIP(ip string) *core.Device
func (*DeviceCache) GetDeviceExpiration ¶
func (c *DeviceCache) GetDeviceExpiration(deviceID string) (time.Time, bool)
func (*DeviceCache) GetDevicesFoundByIP ¶
func (c *DeviceCache) GetDevicesFoundByIP() map[string]string
func (*DeviceCache) LoadAndDeleteDevice ¶
func (c *DeviceCache) LoadAndDeleteDevice(deviceID string) (*core.Device, bool)
LoadAndDeleteDevice loads the device from the cache and deletes it from the cache. To cleanup the device you have to call device.Close.
func (*DeviceCache) LoadAndDeleteDevices ¶
func (c *DeviceCache) LoadAndDeleteDevices(deviceIDFilter []string) []*core.Device
func (*DeviceCache) TryToChangeDeviceExpirationToDefault ¶
func (c *DeviceCache) TryToChangeDeviceExpirationToDefault(deviceID string) bool
TryToChangeDeviceExpirationToDefault attempts to change the expiration time for the device in cache to default expiration.
func (*DeviceCache) UpdateOrStoreDevice ¶
UpdateOrStoreDevice stores the device without timeout into the cache. The device can be removed from the cache only by invoking LoadAndDeleteDevice function and device.Close to cleanup connections. If a device with the same deviceID is already in the cache, the previous reference will be updated in the cache and it's expiration time will be set to infinite.
func (*DeviceCache) UpdateOrStoreDeviceWithExpiration ¶
UpdateOrStoreDeviceWithExpiration stores the device with the default timeout into the cache. If a device with the same deviceID is already in the cache the device will be updated and the expiration time will be reset only when the device has it set.
type DeviceDetails ¶
type DeviceDetails struct { // ID of the device ID string // IP used to find this device FoundByIP string // Details result of function which can be set via option WithGetDetails(), by default it is nil. Details interface{} // IsSecured is secured. IsSecured bool // Ownership describes ownership of the device, for unsecure device it is nil. Ownership *doxm.Doxm // Resources list of the device resources. Resources schema.ResourceLinks // Resources list of the device endpoints. Endpoints []schema.Endpoint // Ownership status OwnershipStatus OwnershipStatus }
DeviceDetails describes a device.
type DeviceOwner ¶
type DeviceOwner interface { Initialization(ctx context.Context) error OwnDevice(ctx context.Context, deviceID string, otmTypes []OTMType, discoveryConfiguration core.DiscoveryConfiguration, own ownFunc, opts ...core.OwnOption) (string, error) GetIdentityCertificate() (tls.Certificate, error) GetIdentityCACerts() ([]*x509.Certificate, error) }
func NewDeviceOwnerFromConfig ¶
func NewDeviceOwnerFromConfig(cfg *Config, dialTLS core.DialTLS, dialDTLS core.DialDTLS, app ApplicationCallback) (DeviceOwner, error)
type DeviceOwnershipSDKConfig ¶
type DeviceOwnershipSDKConfig struct { ID string Cert string CertKey string ValidFrom string // RFC3339, or now-1m, empty means now-1m CertExpiry *string CreateSignerFunc func(caCert []*x509.Certificate, caKey crypto.PrivateKey, validNotBefore time.Time, validNotAfter time.Time) core.CertificateSigner }
type DeviceResourcesObservationHandler ¶
type DeviceResourcesObservationHandler = interface { Handle(ctx context.Context, links schema.ResourceLinks) OnClose() Error(err error) }
type DevicesObservationEvent ¶
type DevicesObservationEvent struct { DeviceID string Event DevicesObservationEvent_type }
type DevicesObservationEvent_type ¶
type DevicesObservationEvent_type uint8
const ( DevicesObservationEvent_ONLINE DevicesObservationEvent_type = 0 DevicesObservationEvent_OFFLINE DevicesObservationEvent_type = 1 )
type DevicesObservationHandler ¶
type DevicesObservationHandler = interface { Handle(ctx context.Context, event DevicesObservationEvent) error OnClose() Error(err error) }
type DiscoveryConfigurationOption ¶
type DiscoveryConfigurationOption struct {
// contains filtered or unexported fields
}
func WithDiscoveryConfiguration ¶
func WithDiscoveryConfiguration(cfg core.DiscoveryConfiguration) DiscoveryConfigurationOption
WithDiscoveryConfiguration allows to setup multicast request. By default it is send to ipv4 and ipv6.
type GetDetailsFunc ¶
type GetDetailsOption ¶
type GetDetailsOption struct {
// contains filtered or unexported fields
}
func WithGetDetails ¶
func WithGetDetails(getDetails func(ctx context.Context, d *core.Device, links schema.ResourceLinks) (interface{}, error)) GetDetailsOption
type GetDeviceByIPOption ¶
type GetDeviceByIPOption = interface {
// contains filtered or unexported methods
}
GetDeviceByIPOption option definition.
type GetDeviceOption ¶
type GetDeviceOption = interface {
// contains filtered or unexported methods
}
GetDeviceOption option definition.
type GetDevicesOption ¶
type GetDevicesOption = interface {
// contains filtered or unexported methods
}
GetDevicesOption option definition.
type GetDevicesWithHandlerOption ¶
type GetDevicesWithHandlerOption = interface {
// contains filtered or unexported methods
}
type GetOption ¶
type GetOption = interface {
// contains filtered or unexported methods
}
GetOption option definition.
type ObserveDevicesOption ¶
type ObserveDevicesOption = interface {
// contains filtered or unexported methods
}
type ObserveOption ¶
type ObserveOption = interface {
// contains filtered or unexported methods
}
ObserveOption option definition.
type ObserverConfig ¶ added in v2.1.0
type ObserverConfig struct { // PollingInterval is a time between two consecutive observations. PollingInterval time.Duration // FailureThreshold is a number of consecutive observation failures after which the device is marked as offline. FailureThreshold uint8 }
ObserverConfig is a configuration of the devices observation.
type OwnOption ¶
type OwnOption = interface {
// contains filtered or unexported methods
}
OwnOption option definition.
func WithActionAfterOwn ¶ added in v2.0.1
func WithActionAfterOwn(actionAfterOwn func(ctx context.Context, client *coap.ClientCloseHandler) error) OwnOption
WithActionAfterOwn allows initialize configuration at the device via DTLS connection with preshared key. For example setup time / NTP. if it returns error device will be disowned.
func WithActionDuringOwn ¶
func WithActionDuringOwn(actionDuringOwn func(ctx context.Context, client *coap.ClientCloseHandler) (string, error)) OwnOption
WithActionDuringOwn allows to set deviceID of owned device and other staff over owner TLS. returns new deviceID, if it returns error device will be disowned.
func WithOTMs ¶
WithOTMs allows to set ownership transfer methods, by default it is []OTMType{manufacturer}. For owning, the first match in order of OTMType with the device will be used.
func WithPresharedKey ¶
WithPresharedKey allows to set preshared key for owner. It is not set, it will be randomized.
type OwnershipStatus ¶
type OwnershipStatus string
OwnershipStatus describes ownership status of the device
const ( // OwnershipStatus_ReadyToBeOwned the device is ready to be owned. OwnershipStatus_ReadyToBeOwned OwnershipStatus = "readytobeowned" // OwnershipStatus_Owned the device is owned. OwnershipStatus_Owned OwnershipStatus = "owned" // OwnershipStatus_OwnedByOther the device is owned by another user. OwnershipStatus_OwnedByOther OwnershipStatus = "ownedbyother" // OwnershipStatus_Unknown the device is unsecure or cannot obtain his status. OwnershipStatus_Unknown OwnershipStatus = "unknown" )
type ResourceETagOption ¶ added in v2.2.1
type ResourceETagOption struct {
// contains filtered or unexported fields
}
func WithETag ¶ added in v2.2.1
func WithETag(etag []byte) ResourceETagOption
type ResourceInterfaceOption ¶
type ResourceInterfaceOption struct {
// contains filtered or unexported fields
}
func WithInterface ¶
func WithInterface(resourceInterface string) ResourceInterfaceOption
WithInterface updates/gets resource with interface directly from a device.
type ResourceQueryOption ¶ added in v2.2.1
type ResourceQueryOption struct {
// contains filtered or unexported fields
}
func WithQuery ¶ added in v2.2.1
func WithQuery(resourceQuery string) ResourceQueryOption
WithQuery updates/gets resource with a query directly from a device.
type ResourceTypesOption ¶
type ResourceTypesOption struct {
// contains filtered or unexported fields
}
func WithResourceTypes ¶
func WithResourceTypes(resourceTypes ...string) ResourceTypesOption
type UpdateOption ¶
type UpdateOption = interface {
// contains filtered or unexported methods
}
UpdateOption option definition.
Source Files ¶
- client.go
- createResource.go
- deleteDevices.go
- deleteResource.go
- deviceCache.go
- deviceOwnershipBackend.go
- deviceOwnershipNone.go
- deviceOwnershipSDK.go
- disownDevice.go
- getDevice.go
- getDevices.go
- getResource.go
- initialization.go
- maitenance.go
- observeDeviceResources.go
- observeDevices.go
- observeResource.go
- offboardDevice.go
- onboardDevice.go
- options.go
- ownDevice.go
- patchResourceLinksEndpoints.go
- updateResource.go