Skip to content

Improve struct comments #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions command/config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ import (
)

// InitParams contains the parameters needed to initialize a configuration file.
// DestDir - destination directory in which the configuration file will be saved.
// Overwrite - specify if existing config file should be overwritten.
// Format - the config file format, can be 'json' or 'yaml'.
type InitParams struct {
DestDir string
Overwrite bool
Format string
DestDir string // Destination directory in which the configuration file will be saved
Overwrite bool // Overwrite specifies if existing config file should be overwritten
Format string // Config file format, can be 'json' or 'yaml'
}

func validateFormatString(arg string) error {
Expand Down
9 changes: 3 additions & 6 deletions command/device/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ import (

// CreateParams contains the parameters needed
// to find the device to be provisioned.
// Name - mandatory parameter.
// Port - optional parameter. If omitted then each serial port is analyzed.
// Fqbn - optional parameter. If omitted then the first device found gets selected.
type CreateParams struct {
Name string
Port *string
Fqbn *string
Name string // Device name
Port *string // Serial port - Optional - If omitted then each serial port is analyzed
Fqbn *string // Board FQBN - Optional - If omitted then the first device found gets selected
}

type board struct {
Expand Down
6 changes: 2 additions & 4 deletions command/thing/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import (

// BindParams contains the parameters needed to
// bind a thing to a device.
// ID indicates the thing to bind.
// deviceID indicates the device bind.
type BindParams struct {
ID string
DeviceID string
ID string // ID of the thing to be bound
DeviceID string // ID of the device to be bound
}

// Bind command is used to bind a thing to a device
Expand Down
6 changes: 2 additions & 4 deletions command/thing/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import (

// CloneParams contains the parameters needed to clone a thing.
type CloneParams struct {
// Mandatory - contains the name of the thing
Name string
// Mandatory - specifies ID of thing to be cloned
CloneID string
Name string // Name of the new thing
CloneID string // ID of thing to be cloned
}

// Clone allows to create a new thing from an already existing one
Expand Down
6 changes: 2 additions & 4 deletions command/thing/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import (

// CreateParams contains the parameters needed to create a new thing.
type CreateParams struct {
// Optional - contains the name of the thing
Name *string
// Mandatory - contains the path of the template file
Template string
Name *string // Name of the new thing
Template string // Path of the template file
}

// Create allows to create a new thing
Expand Down
8 changes: 3 additions & 5 deletions command/thing/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ import (
)

// ExtractParams contains the parameters needed to
// extract a thing from Arduino IoT Cloud and save it on local storage.
// Format determines the file format of the template ("json" or "yaml")
// Output indicates the destination path of the extraction.
// extract a template thing from Arduino IoT Cloud and save it on local storage.
type ExtractParams struct {
ID string
Format string
Outfile *string
Format string // Format determines the file format of the template ("json" or "yaml")
Outfile *string // Destination path of the extracted template
}

// Extract command is used to extract a thing template
Expand Down
9 changes: 3 additions & 6 deletions command/thing/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ import (

// ListParams contains the optional parameters needed
// to filter the things to be listed.
// If IDs is valid, only things belonging to that list are listed.
// If DeviceID is provided, only things associated to that device are listed.
// If Variables is true, variables names are retrieved.
type ListParams struct {
IDs []string
DeviceID *string
Variables bool
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.
}

// List command is used to list
Expand Down
6 changes: 2 additions & 4 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import (
// Config contains all the configuration parameters
// known by iot-cloud-cli
type Config struct {
// Client ID of the user
Client string `map-structure:"client"`
// Secret ID of the user, unique for each Client ID
Secret string `map-structure:"secret"`
Client string `map-structure:"client"` // Client ID of the user
Secret string `map-structure:"secret"` // Secret ID of the user, unique for each Client ID
}

// Retrieve returns the actual parameters contained in the
Expand Down