File tree 8 files changed +20
-39
lines changed
8 files changed +20
-39
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,10 @@ import (
11
11
)
12
12
13
13
// InitParams contains the parameters needed to initialize a configuration file.
14
- // DestDir - destination directory in which the configuration file will be saved.
15
- // Overwrite - specify if existing config file should be overwritten.
16
- // Format - the config file format, can be 'json' or 'yaml'.
17
14
type InitParams struct {
18
- DestDir string
19
- Overwrite bool
20
- Format string
15
+ DestDir string // Destination directory in which the configuration file will be saved
16
+ Overwrite bool // Overwrite specifies if existing config file should be overwritten
17
+ Format string // Config file format, can be 'json' or 'yaml'
21
18
}
22
19
23
20
func validateFormatString (arg string ) error {
Original file line number Diff line number Diff line change @@ -14,13 +14,10 @@ import (
14
14
15
15
// CreateParams contains the parameters needed
16
16
// to find the device to be provisioned.
17
- // Name - mandatory parameter.
18
- // Port - optional parameter. If omitted then each serial port is analyzed.
19
- // Fqbn - optional parameter. If omitted then the first device found gets selected.
20
17
type CreateParams struct {
21
- Name string
22
- Port * string
23
- Fqbn * string
18
+ Name string // Device name
19
+ Port * string // Serial port - Optional - If omitted then each serial port is analyzed
20
+ Fqbn * string // Board FQBN - Optional - If omitted then the first device found gets selected
24
21
}
25
22
26
23
type board struct {
Original file line number Diff line number Diff line change @@ -8,11 +8,9 @@ import (
8
8
9
9
// BindParams contains the parameters needed to
10
10
// bind a thing to a device.
11
- // ID indicates the thing to bind.
12
- // deviceID indicates the device bind.
13
11
type BindParams struct {
14
- ID string
15
- DeviceID string
12
+ ID string // ID of the thing to be bound
13
+ DeviceID string // ID of the device to be bound
16
14
}
17
15
18
16
// Bind command is used to bind a thing to a device
Original file line number Diff line number Diff line change @@ -10,10 +10,8 @@ import (
10
10
11
11
// CloneParams contains the parameters needed to clone a thing.
12
12
type CloneParams struct {
13
- // Mandatory - contains the name of the thing
14
- Name string
15
- // Mandatory - specifies ID of thing to be cloned
16
- CloneID string
13
+ Name string // Name of the new thing
14
+ CloneID string // ID of thing to be cloned
17
15
}
18
16
19
17
// Clone allows to create a new thing from an already existing one
Original file line number Diff line number Diff line change @@ -15,10 +15,8 @@ import (
15
15
16
16
// CreateParams contains the parameters needed to create a new thing.
17
17
type CreateParams struct {
18
- // Optional - contains the name of the thing
19
- Name * string
20
- // Mandatory - contains the path of the template file
21
- Template string
18
+ Name * string // Name of the new thing
19
+ Template string // Path of the template file
22
20
}
23
21
24
22
// Create allows to create a new thing
Original file line number Diff line number Diff line change @@ -15,13 +15,11 @@ import (
15
15
)
16
16
17
17
// ExtractParams contains the parameters needed to
18
- // extract a thing from Arduino IoT Cloud and save it on local storage.
19
- // Format determines the file format of the template ("json" or "yaml")
20
- // Output indicates the destination path of the extraction.
18
+ // extract a template thing from Arduino IoT Cloud and save it on local storage.
21
19
type ExtractParams struct {
22
20
ID string
23
- Format string
24
- Outfile * string
21
+ Format string // Format determines the file format of the template ("json" or "yaml")
22
+ Outfile * string // Destination path of the extracted template
25
23
}
26
24
27
25
// Extract command is used to extract a thing template
Original file line number Diff line number Diff line change @@ -7,13 +7,10 @@ import (
7
7
8
8
// ListParams contains the optional parameters needed
9
9
// to filter the things to be listed.
10
- // If IDs is valid, only things belonging to that list are listed.
11
- // If DeviceID is provided, only things associated to that device are listed.
12
- // If Variables is true, variables names are retrieved.
13
10
type ListParams struct {
14
- IDs []string
15
- DeviceID * string
16
- Variables bool
11
+ IDs []string // If IDs is not nil, only things belonging to that list are returned
12
+ DeviceID * string // If DeviceID is provided, only the thing associated to that device is listed.
13
+ Variables bool // If Variables is true, variable names are retrieved.
17
14
}
18
15
19
16
// List command is used to list
Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ import (
9
9
// Config contains all the configuration parameters
10
10
// known by iot-cloud-cli
11
11
type Config struct {
12
- // Client ID of the user
13
- Client string `map-structure:"client"`
14
- // Secret ID of the user, unique for each Client ID
15
- Secret string `map-structure:"secret"`
12
+ Client string `map-structure:"client"` // Client ID of the user
13
+ Secret string `map-structure:"secret"` // Secret ID of the user, unique for each Client ID
16
14
}
17
15
18
16
// Retrieve returns the actual parameters contained in the
You can’t perform that action at this time.
0 commit comments