Versions in this module Expand all Collapse all v0 v0.9.2 Oct 11, 2023 Changes in this version + func FromAMQPMessage(msg *amqp.Message) *common.Message + func ParseConnectionString(cs string) (*common.SharedAccessKey, error) + type AckType string + const AckFull + const AckNegative + const AckNone + const AckPositive + type AuthType string + const AuthCA + const AuthSAS + const AuthSelfSigned + type Authentication struct + SymmetricKey *SymmetricKey + Type AuthType + X509Thumbprint *X509Thumbprint + type BadRequestError struct + ExceptionMessage string + Message string + func (e *BadRequestError) Error() string + type BulkError struct + DeviceID string + ErrorCode uint + ErrorStatus string + type BulkResult struct + Errors []*BulkError + IsSuccessful bool + Warnings []interface{} + type CallDigitalTwinOption func(q url.Values) + func WithCallDigitalTwinConnectTimeout(seconds int) CallDigitalTwinOption + func WithCallDigitalTwinResponseTimeout(seconds int) CallDigitalTwinOption + type Client struct + func New(sak *common.SharedAccessKey, opts ...ClientOption) (*Client, error) + func NewFromConnectionString(cs string, opts ...ClientOption) (*Client, error) + func (c *Client) ApplyConfigurationContentOnDevice(ctx context.Context, deviceID string, content *ConfigurationContent) error + func (c *Client) CallDeviceMethod(ctx context.Context, deviceID string, call *MethodCall) (*MethodResult, error) + func (c *Client) CallDigitalTwin(ctx context.Context, digitalTwinID, command string, payload []byte, ...) (int, map[string]interface{}, error) + func (c *Client) CallDigitalTwinComponent(ctx context.Context, digitalTwinID, component, command string, payload []byte, ...) (int, map[string]interface{}, error) + func (c *Client) CallModuleMethod(ctx context.Context, deviceID, moduleID string, call *MethodCall) (*MethodResult, error) + func (c *Client) CancelJob(ctx context.Context, jobID string) (map[string]interface{}, error) + func (c *Client) CancelJobV2(ctx context.Context, jobID string) (*JobV2, error) + func (c *Client) Close() error + func (c *Client) CreateConfiguration(ctx context.Context, config *Configuration) (*Configuration, error) + func (c *Client) CreateDevice(ctx context.Context, device *Device) (*Device, error) + func (c *Client) CreateDevices(ctx context.Context, devices []*Device) (*BulkResult, error) + func (c *Client) CreateJob(ctx context.Context, job *Job) (map[string]interface{}, error) + func (c *Client) CreateJobV2(ctx context.Context, job *JobV2) (*JobV2, error) + func (c *Client) CreateModule(ctx context.Context, module *Module) (*Module, error) + func (c *Client) DeleteConfiguration(ctx context.Context, config *Configuration) error + func (c *Client) DeleteDevice(ctx context.Context, device *Device) error + func (c *Client) DeleteDevices(ctx context.Context, devices []*Device, force bool) (*BulkResult, error) + func (c *Client) DeleteModule(ctx context.Context, module *Module) error + func (c *Client) DeviceConnectionString(device *Device, secondary bool) (string, error) + func (c *Client) DeviceSAS(device *Device, resource string, duration time.Duration, secondary bool) (string, error) + func (c *Client) DeviceStats(ctx context.Context) (*DeviceStats, error) + func (c *Client) GetConfiguration(ctx context.Context, configID string) (*Configuration, error) + func (c *Client) GetDevice(ctx context.Context, deviceID string) (*Device, error) + func (c *Client) GetDeviceTwin(ctx context.Context, deviceID string) (*Twin, error) + func (c *Client) GetDigitalTwin(ctx context.Context, digitalTwinID string) (map[string]interface{}, error) + func (c *Client) GetJob(ctx context.Context, jobID string) (map[string]interface{}, error) + func (c *Client) GetJobV2(ctx context.Context, jobID string) (*JobV2, error) + func (c *Client) GetModule(ctx context.Context, deviceID, moduleID string) (*Module, error) + func (c *Client) GetModuleTwin(ctx context.Context, deviceID, moduleID string) (*ModuleTwin, error) + func (c *Client) HostName() string + func (c *Client) ListConfigurations(ctx context.Context) ([]*Configuration, error) + func (c *Client) ListDevices(ctx context.Context) ([]*Device, error) + func (c *Client) ListJobs(ctx context.Context) ([]map[string]interface{}, error) + func (c *Client) ListModules(ctx context.Context, deviceID string) ([]*Module, error) + func (c *Client) ModuleConnectionString(module *Module, secondary bool) (string, error) + func (c *Client) PurgeQueue(ctx context.Context, deviceID string) (*PurgeMessageQueueResult, error) + func (c *Client) QueryDevices(ctx context.Context, query string, fn func(v map[string]interface{}) error) error + func (c *Client) QueryJobsV2(ctx context.Context, q *JobV2Query, fn func(*JobV2) error) error + func (c *Client) SendEvent(ctx context.Context, deviceID string, payload []byte, opts ...SendOption) error + func (c *Client) ServiceStats(ctx context.Context) (*ServiceStats, error) + func (c *Client) SubscribeEvents(ctx context.Context, fn EventHandler) error + func (c *Client) SubscribeFeedback(ctx context.Context, fn FeedbackHandler) error + func (c *Client) SubscribeFileNotifications(ctx context.Context, fn FileNotificationHandler) error + func (c *Client) UpdateConfiguration(ctx context.Context, config *Configuration) (*Configuration, error) + func (c *Client) UpdateDevice(ctx context.Context, device *Device) (*Device, error) + func (c *Client) UpdateDeviceTwin(ctx context.Context, twin *Twin) (*Twin, error) + func (c *Client) UpdateDeviceTwins(ctx context.Context, devices []*Device, force bool) (*BulkResult, error) + func (c *Client) UpdateDevices(ctx context.Context, devices []*Device, force bool) (*BulkResult, error) + func (c *Client) UpdateDigitalTwin(ctx context.Context, digitalTwinID string, patch []map[string]interface{}) (map[string]interface{}, error) + func (c *Client) UpdateModule(ctx context.Context, module *Module) (*Module, error) + func (c *Client) UpdateModuleTwin(ctx context.Context, twin *ModuleTwin) (*ModuleTwin, error) + type ClientOption func(c *Client) + func WithHTTPClient(client *http.Client) ClientOption + func WithLogger(l logger.Logger) ClientOption + func WithTLSConfig(config *tls.Config) ClientOption + type Configuration struct + Content *ConfigurationContent + CreatedTimeUTC *time.Time + ETag string + ID string + Labels map[string]string + LastUpdatedTimeUTC *time.Time + Metrics *ConfigurationMetrics + Priority uint + SchemaVersion string + SystemMetrics *ConfigurationMetrics + TargetCondition string + type ConfigurationContent struct + DeviceContent map[string]interface{} + ModulesContent map[string]interface{} + type ConfigurationMetrics struct + Queries map[string]string + Results map[string]uint + type ConnectionState string + const Connected + const Disconnected + type Deployment struct + Content *DeploymentContent + ETag string + ID string + Labels map[string]string + Metrics *ConfigurationMetrics + Priority uint + TargetCondition string + type DeploymentContent struct + ModulesContent map[string]interface{} + type Device struct + Authentication *Authentication + Capabilities map[string]interface{} + CloudToDeviceMessageCount uint + ConnectionState ConnectionState + ConnectionStateUpdatedTime *MicrosoftTime + DeviceID string + ETag string + GenerationID string + LastActivityTime *MicrosoftTime + Properties *Properties + Status DeviceStatus + StatusReason string + StatusUpdatedTime *MicrosoftTime + Tags map[string]interface{} + type DeviceMethodParams struct + MethodName string + Payload interface{} + TimeoutInSeconds uint + type DeviceStats struct + DisabledDeviceCount uint + EnabledDeviceCount uint + TotalDeviceCount uint + type DeviceStatus string + const Disabled + const Enabled + type Event struct + type EventHandler func(e *Event) error + type Feedback struct + Description string + DeviceGenerationID string + DeviceID string + EnqueuedTimeUTC time.Time + OriginalMessageID string + StatusCode string + type FeedbackHandler func(f *Feedback) error + type FileNotification struct + BlobName string + BlobSizeInBytes int64 + BlobURI string + DeviceID string + EnqueuedTime time.Time + LastUpdatedTime time.Time + type FileNotificationHandler func(event *FileNotification) error + type Job struct + ExcludeKeysInExport bool + InputBlobContainerURI string + OutputBlobContainerURI string + Type JobType + type JobType string + const JobExport + const JobImport + type JobV2 struct + CloudToDeviceMethod *DeviceMethodParams + JobID string + MaxExecutionTimeInSeconds uint + QueryCondition string + StartTime time.Time + Status JobV2Status + Type JobV2Type + UpdateTwin interface{} + type JobV2Query struct + Status JobV2Status + Type JobV2Type + type JobV2Status string + const JobStatusCancelled + const JobStatusCompleted + const JobStatusQueued + const JobStatusRunning + const JobStatusScheduled + const JobStatusUnknown + type JobV2Type string + const JobTypeDeviceMethod + const JobTypeUnknown + const JobTypeUpdateTwin + type MethodCall struct + ConnectTimeout uint + MethodName string + Payload map[string]interface{} + ResponseTimeout uint + type MethodResult struct + Payload map[string]interface{} + Status int + type MicrosoftTime struct + func (t *MicrosoftTime) UnmarshalJSON(b []byte) error + type Module struct + Authentication *Authentication + CloudToDeviceMessageCount uint + ConnectionState ConnectionState + ConnectionStateUpdatedTime *MicrosoftTime + DeviceID string + ETag string + GenerationID string + LastActivityTime *MicrosoftTime + ManagedBy string + ModuleID string + type ModuleTwin struct + AuthenticationType string + ConnectionState ConnectionState + DeviceETag string + DeviceID string + ETag string + LastActivityTime *MicrosoftTime + ModuleID string + Properties *Properties + Status DeviceStatus + StatusUpdateTime *MicrosoftTime + Tags map[string]interface{} + Version uint + X509Thumbprint *X509Thumbprint + type Properties struct + Desired map[string]interface{} + Reported map[string]interface{} + type PurgeMessageQueueResult struct + DeviceID string + ModuleID string + TotalMessagesPurged int + type RequestError struct + Body []byte + Code int + func (e *RequestError) Error() string + type SendOption func(msg *common.Message) error + func WithSendAck(ack AckType) SendOption + func WithSendCorrelationID(cid string) SendOption + func WithSendExpiryTime(t time.Time) SendOption + func WithSendMessageID(mid string) SendOption + func WithSendProperties(m map[string]string) SendOption + func WithSendProperty(k, v string) SendOption + func WithSendUserID(uid string) SendOption + type ServiceStats struct + ConnectedDeviceCount uint + type SymmetricKey struct + PrimaryKey string + SecondaryKey string + type Twin struct + AuthenticationType string + Capabilities map[string]interface{} + CloudToDeviceMessageCount uint + ConnectionState ConnectionState + DeviceETag string + DeviceID string + ETag string + LastActivityTime *MicrosoftTime + Properties *Properties + Status DeviceStatus + StatusReason string + StatusUpdateTime *MicrosoftTime + Tags map[string]interface{} + Version int + X509Thumbprint *X509Thumbprint + type X509Thumbprint struct + PrimaryThumbprint string + SecondaryThumbprint string