Documentation ¶
Index ¶
- type Client
- func (cl *Client) CertificateCreate(ctx context.Context, id, csr string) (*iotclient.ArduinoCompressedv2, error)
- func (cl *Client) DashboardCreate(ctx context.Context, dashboard *iotclient.Dashboardv2) (*iotclient.ArduinoDashboardv2, error)
- func (cl *Client) DashboardDelete(ctx context.Context, id string) error
- func (cl *Client) DashboardList(ctx context.Context) ([]iotclient.ArduinoDashboardv2, error)
- func (cl *Client) DashboardShow(ctx context.Context, id string) (*iotclient.ArduinoDashboardv2, error)
- func (cl *Client) DeviceCreate(ctx context.Context, fqbn, name, serial, dType string, cType *string) (*iotclient.ArduinoDevicev2, error)
- func (cl *Client) DeviceDelete(ctx context.Context, id string) error
- func (cl *Client) DeviceList(ctx context.Context, tags map[string]string) ([]iotclient.ArduinoDevicev2, error)
- func (cl *Client) DeviceLoraCreate(ctx context.Context, name, serial, devType, eui, freq string) (*iotclient.ArduinoLoradevicev1, error)
- func (cl *Client) DeviceOTA(ctx context.Context, id string, file *os.File, expireMins int) error
- func (cl *Client) DevicePassSet(ctx context.Context, id string) (*iotclient.ArduinoDevicev2Pass, error)
- func (cl *Client) DeviceShow(ctx context.Context, id string) (*iotclient.ArduinoDevicev2, error)
- func (cl *Client) DeviceTagsCreate(ctx context.Context, id string, tags map[string]string) error
- func (cl *Client) DeviceTagsDelete(ctx context.Context, id string, keys []string) error
- func (cl *Client) LoraFrequencyPlansList(ctx context.Context) ([]iotclient.ArduinoLorafreqplanv1, error)
- func (cl *Client) ThingCreate(ctx context.Context, thing *iotclient.ThingCreate, force bool) (*iotclient.ArduinoThing, error)
- func (cl *Client) ThingDelete(ctx context.Context, id string) error
- func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, props bool, ...) ([]iotclient.ArduinoThing, error)
- func (cl *Client) ThingShow(ctx context.Context, id string) (*iotclient.ArduinoThing, error)
- func (cl *Client) ThingTagsCreate(ctx context.Context, id string, tags map[string]string) error
- func (cl *Client) ThingTagsDelete(ctx context.Context, id string, keys []string) error
- func (cl *Client) ThingUpdate(ctx context.Context, id string, thing *iotclient.ThingUpdate, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client can perform actions on Arduino IoT Cloud.
func NewClient ¶
func NewClient(cred *config.Credentials) (*Client, error)
NewClient returns a new client implementing the Client interface. It needs client Credentials for cloud authentication.
func (*Client) CertificateCreate ¶
func (cl *Client) CertificateCreate(ctx context.Context, id, csr string) (*iotclient.ArduinoCompressedv2, error)
CertificateCreate allows to upload a certificate on Arduino IoT Cloud. It returns the certificate parameters populated by the cloud.
func (*Client) DashboardCreate ¶
func (cl *Client) DashboardCreate(ctx context.Context, dashboard *iotclient.Dashboardv2) (*iotclient.ArduinoDashboardv2, error)
DashboardCreate adds a new dashboard on Arduino IoT Cloud.
func (*Client) DashboardDelete ¶
DashboardDelete deletes a dashboard from Arduino IoT Cloud.
func (*Client) DashboardList ¶
DashboardList returns a list of dashboards on Arduino IoT Cloud.
func (*Client) DashboardShow ¶
func (cl *Client) DashboardShow(ctx context.Context, id string) (*iotclient.ArduinoDashboardv2, error)
DashboardShow allows to retrieve a specific dashboard, given its id, from Arduino IoT Cloud.
func (*Client) DeviceCreate ¶
func (cl *Client) DeviceCreate(ctx context.Context, fqbn, name, serial, dType string, cType *string) (*iotclient.ArduinoDevicev2, error)
DeviceCreate allows to create a new device on Arduino IoT Cloud. It returns the newly created device, and an error.
func (*Client) DeviceDelete ¶
DeviceDelete deletes the device corresponding to the passed ID from Arduino IoT Cloud.
func (*Client) DeviceList ¶
func (cl *Client) DeviceList(ctx context.Context, tags map[string]string) ([]iotclient.ArduinoDevicev2, error)
DeviceList retrieves and returns a list of all Arduino IoT Cloud devices belonging to the user performing the request.
func (*Client) DeviceLoraCreate ¶
func (cl *Client) DeviceLoraCreate(ctx context.Context, name, serial, devType, eui, freq string) (*iotclient.ArduinoLoradevicev1, error)
DeviceLoraCreate allows to create a new LoRa device on Arduino IoT Cloud. It returns the LoRa information about the newly created device, and an error.
func (*Client) DeviceOTA ¶
DeviceOTA performs an OTA upload request to Arduino IoT Cloud, passing the ID of the device to be updated and the actual file containing the OTA firmware.
func (*Client) DevicePassSet ¶
func (cl *Client) DevicePassSet(ctx context.Context, id string) (*iotclient.ArduinoDevicev2Pass, error)
DevicePassSet sets the device password to the one suggested by Arduino IoT Cloud. Returns the set password.
func (*Client) DeviceShow ¶
DeviceShow allows to retrieve a specific device, given its id, from Arduino IoT Cloud.
func (*Client) DeviceTagsCreate ¶
DeviceTagsCreate allows to create or overwrite tags on a device of Arduino IoT Cloud.
func (*Client) DeviceTagsDelete ¶
DeviceTagsDelete deletes the tags of a device of Arduino IoT Cloud, given the device id and the keys of the tags.
func (*Client) LoraFrequencyPlansList ¶
func (cl *Client) LoraFrequencyPlansList(ctx context.Context) ([]iotclient.ArduinoLorafreqplanv1, error)
LoraFrequencyPlansList retrieves and returns the list of all supported LoRa frequency plans.
func (*Client) ThingCreate ¶
func (cl *Client) ThingCreate(ctx context.Context, thing *iotclient.ThingCreate, force bool) (*iotclient.ArduinoThing, error)
ThingCreate adds a new thing on Arduino IoT Cloud.
func (*Client) ThingDelete ¶
ThingDelete deletes a thing from Arduino IoT Cloud.
func (*Client) ThingList ¶
func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, props bool, tags map[string]string) ([]iotclient.ArduinoThing, error)
ThingList returns a list of things on Arduino IoT Cloud.
func (*Client) ThingShow ¶
ThingShow allows to retrieve a specific thing, given its id, from Arduino IoT Cloud.
func (*Client) ThingTagsCreate ¶
ThingTagsCreate allows to create or overwrite tags on a thing of Arduino IoT Cloud.
func (*Client) ThingTagsDelete ¶
ThingTagsDelete deletes the tags of a thing of Arduino IoT Cloud, given the thing id and the keys of the tags.
func (*Client) ThingUpdate ¶
func (cl *Client) ThingUpdate(ctx context.Context, id string, thing *iotclient.ThingUpdate, force bool) error
ThingUpdate updates a thing on Arduino IoT Cloud.