thing

package
v0.0.0-...-83a780d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(ctx context.Context, params *BindParams, cred *config.Credentials) error

Bind command is used to bind a thing to a device on Arduino IoT Cloud.

func Delete

func Delete(ctx context.Context, params *DeleteParams, cred *config.Credentials) error

Delete command is used to delete a thing from Arduino IoT Cloud.

func Extract

func Extract(ctx context.Context, params *ExtractParams, cred *config.Credentials) (map[string]interface{}, error)

Extract command is used to extract a thing template from a thing on Arduino IoT Cloud.

Types

type BindParams

type BindParams struct {
	ID       string // ID of the thing to be bound
	DeviceID string // ID of the device to be bound
}

BindParams contains the parameters needed to bind a thing to a device.

type CloneParams

type CloneParams struct {
	Name    string // Name of the new thing
	CloneID string // ID of thing to be cloned
}

CloneParams contains the parameters needed to clone a thing.

type CreateParams

type CreateParams struct {
	Name     *string // Name of the new thing
	Template string  // Path of the template file
}

CreateParams contains the parameters needed to create a new thing.

type DeleteParams

type DeleteParams struct {
	ID   *string
	Tags map[string]string
}

DeleteParams contains the parameters needed to delete a thing from Arduino IoT Cloud. ID and Tags parameters are mutually exclusive and one among them is required: An error is returned if they are both nil or if they are both not nil.

type ExtractParams

type ExtractParams struct {
	ID string
}

ExtractParams contains the parameters needed to extract a template thing from Arduino IoT Cloud.

type ListParams

type ListParams struct {
	IDs       []string          // If IDs is not nil, only things belonging to that list are returned
	DeviceID  *string           // If DeviceID is provided, only the thing associated to that device is listed.
	Variables bool              // If Variables is true, variable names are retrieved.
	Tags      map[string]string // If tags are provided, only things that have all these tags are listed.
}

ListParams contains the optional parameters needed to filter the things to be listed.

type ThingInfo

type ThingInfo struct {
	Name      string   `json:"name"`
	ID        string   `json:"id"`
	DeviceID  string   `json:"device_id"`
	Variables []string `json:"variables"`
	Tags      []string `json:"tags,omitempty"`
}

ThingInfo contains the main parameters of an Arduino IoT Cloud thing.

func Clone

func Clone(ctx context.Context, params *CloneParams, cred *config.Credentials) (*ThingInfo, error)

Clone allows to create a new thing from an already existing one.

func Create

func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) (*ThingInfo, error)

Create allows to create a new thing.

func List

func List(ctx context.Context, params *ListParams, cred *config.Credentials) ([]ThingInfo, error)

List command is used to list the things of Arduino IoT Cloud.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL