diff --git a/api/contract/openapi b/api/contract/openapi index 8b5f1bb..3481def 160000 --- a/api/contract/openapi +++ b/api/contract/openapi @@ -1 +1 @@ -Subproject commit 8b5f1bbb2cd388eb454dc9da19e3d2c4061cdf5f +Subproject commit 3481defece3e8c70c47f21680857ac1a7c051a8b diff --git a/api/error.go b/api/error.go index dc8ed94..2951eba 100644 --- a/api/error.go +++ b/api/error.go @@ -13,14 +13,14 @@ type ApiError interface { // Extensions to let our API error types be used as "standard" errors. func (o *Error) Error() string { - if o.Message != "" && o.Err != nil { + if o.Message != nil && o.Err != nil { var b strings.Builder - b.WriteString(o.Message) + b.WriteString(*o.Message) b.WriteString(": ") b.WriteString(*o.Err) return b.String() - } else if o.Message != "" { - return o.Message + } else if o.Message != nil { + return *o.Message } else if o.Err != nil { return *o.Err } @@ -55,7 +55,10 @@ func (o *HealthCheck) ErrorCode() ErrorCode { } func (o *LineProtocolError) Error() string { - return o.Message + if o.Message == nil { + return "" + } + return *o.Message } func (o *LineProtocolError) ErrorCode() ErrorCode { diff --git a/api/model_authorization.gen.go b/api/model_authorization.gen.go index b950337..f296356 100644 --- a/api/model_authorization.gen.go +++ b/api/model_authorization.gen.go @@ -17,24 +17,24 @@ import ( // Authorization struct for Authorization type Authorization struct { - // If inactive the token is inactive and requests using the token will be rejected. + // Status of the token. If `inactive`, requests using the token will be rejected. Status *string `json:"status,omitempty" yaml:"status,omitempty"` // A description of the token. Description *string `json:"description,omitempty" yaml:"description,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty" yaml:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"` - // ID of org that authorization is scoped to. + // ID of the organization that the authorization is scoped to. OrgID string `json:"orgID" yaml:"orgID"` - // List of permissions for an auth. An auth must have at least one Permission. + // List of permissions for an authorization. An authorization must have at least one permission. Permissions []Permission `json:"permissions" yaml:"permissions"` Id *string `json:"id,omitempty" yaml:"id,omitempty"` - // Passed via the Authorization Header and Token Authentication type. + // Token used to authenticate API requests. Token *string `json:"token,omitempty" yaml:"token,omitempty"` - // ID of user that created and owns the token. + // ID of the user that created and owns the token. UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"` - // Name of user that created and owns the token. + // Name of the user that created and owns the token. User *string `json:"user,omitempty" yaml:"user,omitempty"` - // Name of the org token is scoped to. + // Name of the organization that the token is scoped to. Org *string `json:"org,omitempty" yaml:"org,omitempty"` Links *AuthorizationAllOfLinks `json:"links,omitempty" yaml:"links,omitempty"` } diff --git a/api/model_authorization_all_of.gen.go b/api/model_authorization_all_of.gen.go index d1d7ffd..c8416cc 100644 --- a/api/model_authorization_all_of.gen.go +++ b/api/model_authorization_all_of.gen.go @@ -19,18 +19,18 @@ import ( type AuthorizationAllOf struct { CreatedAt *time.Time `json:"createdAt,omitempty" yaml:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"` - // ID of org that authorization is scoped to. + // ID of the organization that the authorization is scoped to. OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"` - // List of permissions for an auth. An auth must have at least one Permission. + // List of permissions for an authorization. An authorization must have at least one permission. Permissions *[]Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"` Id *string `json:"id,omitempty" yaml:"id,omitempty"` - // Passed via the Authorization Header and Token Authentication type. + // Token used to authenticate API requests. Token *string `json:"token,omitempty" yaml:"token,omitempty"` - // ID of user that created and owns the token. + // ID of the user that created and owns the token. UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"` - // Name of user that created and owns the token. + // Name of the user that created and owns the token. User *string `json:"user,omitempty" yaml:"user,omitempty"` - // Name of the org token is scoped to. + // Name of the organization that the token is scoped to. Org *string `json:"org,omitempty" yaml:"org,omitempty"` Links *AuthorizationAllOfLinks `json:"links,omitempty" yaml:"links,omitempty"` } diff --git a/api/model_authorization_post_request.gen.go b/api/model_authorization_post_request.gen.go index d80a738..e264f17 100644 --- a/api/model_authorization_post_request.gen.go +++ b/api/model_authorization_post_request.gen.go @@ -16,7 +16,7 @@ import ( // AuthorizationPostRequest struct for AuthorizationPostRequest type AuthorizationPostRequest struct { - // If inactive the token is inactive and requests using the token will be rejected. + // Status of the token. If `inactive`, requests using the token will be rejected. Status *string `json:"status,omitempty" yaml:"status,omitempty"` // A description of the token. Description *string `json:"description,omitempty" yaml:"description,omitempty"` diff --git a/api/model_authorization_update_request.gen.go b/api/model_authorization_update_request.gen.go index 4f46f5b..8797aaa 100644 --- a/api/model_authorization_update_request.gen.go +++ b/api/model_authorization_update_request.gen.go @@ -16,7 +16,7 @@ import ( // AuthorizationUpdateRequest struct for AuthorizationUpdateRequest type AuthorizationUpdateRequest struct { - // If inactive the token is inactive and requests using the token will be rejected. + // Status of the token. If `inactive`, requests using the token will be rejected. Status *string `json:"status,omitempty" yaml:"status,omitempty"` // A description of the token. Description *string `json:"description,omitempty" yaml:"description,omitempty"` diff --git a/api/model_dbrp.gen.go b/api/model_dbrp.gen.go index efa9fcd..71df5fc 100644 --- a/api/model_dbrp.gen.go +++ b/api/model_dbrp.gen.go @@ -16,17 +16,17 @@ import ( // DBRP struct for DBRP type DBRP struct { - // the mapping identifier + // ID of the DBRP mapping. Id string `json:"id" yaml:"id"` - // the organization ID that owns this mapping. + // ID of the organization that owns this mapping. OrgID string `json:"orgID" yaml:"orgID"` - // the bucket ID used as target for the translation. + // ID of the bucket used as the target for the translation. BucketID string `json:"bucketID" yaml:"bucketID"` // InfluxDB v1 database Database string `json:"database" yaml:"database"` // InfluxDB v1 retention policy RetentionPolicy string `json:"retention_policy" yaml:"retention_policy"` - // Specify if this mapping represents the default retention policy for the database specificed. + // Mapping represents the default retention policy for the database specified. Default bool `json:"default" yaml:"default"` Links *Links `json:"links,omitempty" yaml:"links,omitempty"` } diff --git a/api/model_dbrp_create.gen.go b/api/model_dbrp_create.gen.go index d80eb7e..58285b4 100644 --- a/api/model_dbrp_create.gen.go +++ b/api/model_dbrp_create.gen.go @@ -16,17 +16,17 @@ import ( // DBRPCreate struct for DBRPCreate type DBRPCreate struct { - // the organization ID that owns this mapping. + // ID of the organization that owns this mapping. OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"` - // the organization that owns this mapping. + // Name of the organization that owns this mapping. Org *string `json:"org,omitempty" yaml:"org,omitempty"` - // the bucket ID used as target for the translation. + // ID of the bucket used as the target for the translation. BucketID string `json:"bucketID" yaml:"bucketID"` // InfluxDB v1 database Database string `json:"database" yaml:"database"` // InfluxDB v1 retention policy RetentionPolicy string `json:"retention_policy" yaml:"retention_policy"` - // Specify if this mapping represents the default retention policy for the database specificed. + // Mapping represents the default retention policy for the database specified. Default *bool `json:"default,omitempty" yaml:"default,omitempty"` } diff --git a/api/model_error.gen.go b/api/model_error.gen.go index fa7ce28..97a3c60 100644 --- a/api/model_error.gen.go +++ b/api/model_error.gen.go @@ -17,11 +17,11 @@ import ( // Error struct for Error type Error struct { Code ErrorCode `json:"code" yaml:"code"` - // message is a human-readable message. - Message string `json:"message" yaml:"message"` - // op describes the logical code operation during error. Useful for debugging. + // Human-readable message. + Message *string `json:"message,omitempty" yaml:"message,omitempty"` + // Describes the logical code operation when the error occurred. Useful for debugging. Op *string `json:"op,omitempty" yaml:"op,omitempty"` - // err is a stack of errors that occurred during processing of the request. Useful for debugging. + // Stack of errors that occurred during processing of the request. Useful for debugging. Err *string `json:"err,omitempty" yaml:"err,omitempty"` } @@ -29,10 +29,9 @@ type Error struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewError(code ErrorCode, message string) *Error { +func NewError(code ErrorCode) *Error { this := Error{} this.Code = code - this.Message = message return &this } @@ -68,28 +67,36 @@ func (o *Error) SetCode(v ErrorCode) { o.Code = v } -// GetMessage returns the Message field value +// GetMessage returns the Message field value if set, zero value otherwise. func (o *Error) GetMessage() string { - if o == nil { + if o == nil || o.Message == nil { var ret string return ret } - - return o.Message + return *o.Message } -// GetMessageOk returns a tuple with the Message field value +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Error) GetMessageOk() (*string, bool) { - if o == nil { + if o == nil || o.Message == nil { return nil, false } - return &o.Message, true + return o.Message, true } -// SetMessage sets field value +// HasMessage returns a boolean if a field has been set. +func (o *Error) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. func (o *Error) SetMessage(v string) { - o.Message = v + o.Message = &v } // GetOp returns the Op field value if set, zero value otherwise. @@ -161,7 +168,7 @@ func (o Error) MarshalJSON() ([]byte, error) { if true { toSerialize["code"] = o.Code } - if true { + if o.Message != nil { toSerialize["message"] = o.Message } if o.Op != nil { diff --git a/api/model_legacy_authorization_post_request.gen.go b/api/model_legacy_authorization_post_request.gen.go index 6ff5503..6809641 100644 --- a/api/model_legacy_authorization_post_request.gen.go +++ b/api/model_legacy_authorization_post_request.gen.go @@ -16,7 +16,7 @@ import ( // LegacyAuthorizationPostRequest struct for LegacyAuthorizationPostRequest type LegacyAuthorizationPostRequest struct { - // If inactive the token is inactive and requests using the token will be rejected. + // Status of the token. If `inactive`, requests using the token will be rejected. Status *string `json:"status,omitempty" yaml:"status,omitempty"` // A description of the token. Description *string `json:"description,omitempty" yaml:"description,omitempty"` diff --git a/api/model_line_protocol_error.gen.go b/api/model_line_protocol_error.gen.go index 8ff7ddd..73fe05b 100644 --- a/api/model_line_protocol_error.gen.go +++ b/api/model_line_protocol_error.gen.go @@ -17,13 +17,13 @@ import ( // LineProtocolError struct for LineProtocolError type LineProtocolError struct { Code LineProtocolErrorCode `json:"code" yaml:"code"` - // Message is a human-readable message. - Message string `json:"message" yaml:"message"` - // Op describes the logical code operation during error. Useful for debugging. - Op string `json:"op" yaml:"op"` - // Err is a stack of errors that occurred during processing of the request. Useful for debugging. - Err string `json:"err" yaml:"err"` - // First line within sent body containing malformed data + // Human-readable message. + Message *string `json:"message,omitempty" yaml:"message,omitempty"` + // Describes the logical code operation when the error occurred. Useful for debugging. + Op *string `json:"op,omitempty" yaml:"op,omitempty"` + // Stack of errors that occurred during processing of the request. Useful for debugging. + Err *string `json:"err,omitempty" yaml:"err,omitempty"` + // First line in the request body that contains malformed data. Line *int32 `json:"line,omitempty" yaml:"line,omitempty"` } @@ -31,12 +31,9 @@ type LineProtocolError struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewLineProtocolError(code LineProtocolErrorCode, message string, op string, err string) *LineProtocolError { +func NewLineProtocolError(code LineProtocolErrorCode) *LineProtocolError { this := LineProtocolError{} this.Code = code - this.Message = message - this.Op = op - this.Err = err return &this } @@ -72,76 +69,100 @@ func (o *LineProtocolError) SetCode(v LineProtocolErrorCode) { o.Code = v } -// GetMessage returns the Message field value +// GetMessage returns the Message field value if set, zero value otherwise. func (o *LineProtocolError) GetMessage() string { - if o == nil { + if o == nil || o.Message == nil { var ret string return ret } - - return o.Message + return *o.Message } -// GetMessageOk returns a tuple with the Message field value +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *LineProtocolError) GetMessageOk() (*string, bool) { - if o == nil { + if o == nil || o.Message == nil { return nil, false } - return &o.Message, true + return o.Message, true } -// SetMessage sets field value +// HasMessage returns a boolean if a field has been set. +func (o *LineProtocolError) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. func (o *LineProtocolError) SetMessage(v string) { - o.Message = v + o.Message = &v } -// GetOp returns the Op field value +// GetOp returns the Op field value if set, zero value otherwise. func (o *LineProtocolError) GetOp() string { - if o == nil { + if o == nil || o.Op == nil { var ret string return ret } - - return o.Op + return *o.Op } -// GetOpOk returns a tuple with the Op field value +// GetOpOk returns a tuple with the Op field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *LineProtocolError) GetOpOk() (*string, bool) { - if o == nil { + if o == nil || o.Op == nil { return nil, false } - return &o.Op, true + return o.Op, true } -// SetOp sets field value +// HasOp returns a boolean if a field has been set. +func (o *LineProtocolError) HasOp() bool { + if o != nil && o.Op != nil { + return true + } + + return false +} + +// SetOp gets a reference to the given string and assigns it to the Op field. func (o *LineProtocolError) SetOp(v string) { - o.Op = v + o.Op = &v } -// GetErr returns the Err field value +// GetErr returns the Err field value if set, zero value otherwise. func (o *LineProtocolError) GetErr() string { - if o == nil { + if o == nil || o.Err == nil { var ret string return ret } - - return o.Err + return *o.Err } -// GetErrOk returns a tuple with the Err field value +// GetErrOk returns a tuple with the Err field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *LineProtocolError) GetErrOk() (*string, bool) { - if o == nil { + if o == nil || o.Err == nil { return nil, false } - return &o.Err, true + return o.Err, true } -// SetErr sets field value +// HasErr returns a boolean if a field has been set. +func (o *LineProtocolError) HasErr() bool { + if o != nil && o.Err != nil { + return true + } + + return false +} + +// SetErr gets a reference to the given string and assigns it to the Err field. func (o *LineProtocolError) SetErr(v string) { - o.Err = v + o.Err = &v } // GetLine returns the Line field value if set, zero value otherwise. @@ -181,13 +202,13 @@ func (o LineProtocolError) MarshalJSON() ([]byte, error) { if true { toSerialize["code"] = o.Code } - if true { + if o.Message != nil { toSerialize["message"] = o.Message } - if true { + if o.Op != nil { toSerialize["op"] = o.Op } - if true { + if o.Err != nil { toSerialize["err"] = o.Err } if o.Line != nil { diff --git a/api/model_line_protocol_length_error.gen.go b/api/model_line_protocol_length_error.gen.go index 17a96e2..532fd94 100644 --- a/api/model_line_protocol_length_error.gen.go +++ b/api/model_line_protocol_length_error.gen.go @@ -17,7 +17,7 @@ import ( // LineProtocolLengthError struct for LineProtocolLengthError type LineProtocolLengthError struct { Code LineProtocolLengthErrorCode `json:"code" yaml:"code"` - // Message is a human-readable message. + // Human-readable message. Message string `json:"message" yaml:"message"` } diff --git a/api/model_measurement_schema.gen.go b/api/model_measurement_schema.gen.go index ab0990c..551f34f 100644 --- a/api/model_measurement_schema.gen.go +++ b/api/model_measurement_schema.gen.go @@ -15,15 +15,15 @@ import ( "time" ) -// MeasurementSchema The schema definition for a single measurement +// MeasurementSchema Definition of a measurement schema. type MeasurementSchema struct { Id string `json:"id" yaml:"id"` - // ID of organization that the measurement schema is associated with. + // ID of the organization that the measurement schema is associated with. OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"` // ID of the bucket that the measurement schema is associated with. BucketID *string `json:"bucketID,omitempty" yaml:"bucketID,omitempty"` Name string `json:"name" yaml:"name"` - // An ordered collection of column definitions + // Ordered collection of column definitions. Columns []MeasurementSchemaColumn `json:"columns" yaml:"columns"` CreatedAt time.Time `json:"createdAt" yaml:"createdAt"` UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"` diff --git a/api/model_measurement_schema_column.gen.go b/api/model_measurement_schema_column.gen.go index 3971118..63eda54 100644 --- a/api/model_measurement_schema_column.gen.go +++ b/api/model_measurement_schema_column.gen.go @@ -14,7 +14,7 @@ import ( "encoding/json" ) -// MeasurementSchemaColumn Definition of a measurement column +// MeasurementSchemaColumn Definition of a measurement schema column. type MeasurementSchemaColumn struct { Name string `json:"name" yaml:"name"` Type ColumnSemanticType `json:"type" yaml:"type"` diff --git a/api/model_measurement_schema_create_request.gen.go b/api/model_measurement_schema_create_request.gen.go index b8321e7..6fecf48 100644 --- a/api/model_measurement_schema_create_request.gen.go +++ b/api/model_measurement_schema_create_request.gen.go @@ -14,10 +14,10 @@ import ( "encoding/json" ) -// MeasurementSchemaCreateRequest Create a new measurement schema +// MeasurementSchemaCreateRequest Create a new measurement schema. type MeasurementSchemaCreateRequest struct { Name string `json:"name" yaml:"name"` - // An ordered collection of column definitions + // Ordered collection of column definitions. Columns []MeasurementSchemaColumn `json:"columns" yaml:"columns"` } diff --git a/api/model_task.gen.go b/api/model_task.gen.go index d9265b4..06b9747 100644 --- a/api/model_task.gen.go +++ b/api/model_task.gen.go @@ -18,31 +18,31 @@ import ( // Task struct for Task type Task struct { Id string `json:"id" yaml:"id"` - // The type of task, this can be used for filtering tasks on list actions. + // Type of the task, useful for filtering a task list. Type *string `json:"type,omitempty" yaml:"type,omitempty"` - // The ID of the organization that owns this Task. + // ID of the organization that owns the task. OrgID string `json:"orgID" yaml:"orgID"` - // The name of the organization that owns this Task. + // Name of the organization that owns the task. Org *string `json:"org,omitempty" yaml:"org,omitempty"` - // The name of the task. + // Name of the task. Name string `json:"name" yaml:"name"` - // The ID of the user who owns this Task. + // ID of the user who owns this Task. OwnerID *string `json:"ownerID,omitempty" yaml:"ownerID,omitempty"` - // An optional description of the task. + // Description of the task. Description *string `json:"description,omitempty" yaml:"description,omitempty"` Status *TaskStatusType `json:"status,omitempty" yaml:"status,omitempty"` Labels *[]Label `json:"labels,omitempty" yaml:"labels,omitempty"` - // The ID of the authorization used when this task communicates with the query engine. + // ID of the authorization used when the task communicates with the query engine. AuthorizationID *string `json:"authorizationID,omitempty" yaml:"authorizationID,omitempty"` - // The Flux script to run for this task. + // Flux script to run for this task. Flux string `json:"flux" yaml:"flux"` - // A simple task repetition schedule; parsed from Flux. + // Interval at which the task runs. `every` also determines when the task first runs, depending on the specified time. Value is a [duration literal](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals)). Every *string `json:"every,omitempty" yaml:"every,omitempty"` - // A task repetition schedule in the form '* * * * * *'; parsed from Flux. + // [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview) that defines the schedule on which the task runs. Cron scheduling is based on system time. Value is a [Cron expression](https://en.wikipedia.org/wiki/Cron#Overview). Cron *string `json:"cron,omitempty" yaml:"cron,omitempty"` - // Duration to delay after the schedule, before executing the task; parsed from flux, if set to zero it will remove this option and use 0 as the default. + // [Duration](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to delay execution of the task after the scheduled time has elapsed. `0` removes the offset. The value is a [duration literal](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals). Offset *string `json:"offset,omitempty" yaml:"offset,omitempty"` - // Timestamp of latest scheduled, completed run, RFC3339. + // Timestamp of the latest scheduled and completed run. Value is a timestamp in [RFC3339 date/time format](https://docs.influxdata.com/flux/v0.x/data-types/basic/time/#time-syntax). LatestCompleted *time.Time `json:"latestCompleted,omitempty" yaml:"latestCompleted,omitempty"` LastRunStatus *string `json:"lastRunStatus,omitempty" yaml:"lastRunStatus,omitempty"` LastRunError *string `json:"lastRunError,omitempty" yaml:"lastRunError,omitempty"` diff --git a/config/config.go b/config/config.go index 8d1eb95..8139fff 100644 --- a/config/config.go +++ b/config/config.go @@ -66,7 +66,7 @@ func (cfgs Configs) switchActive(name string) error { if _, ok := cfgs[name]; !ok { return &api.Error{ Code: api.ERRORCODE_NOT_FOUND, - Message: fmt.Sprintf("config %q is not found", name), + Message: api.PtrString(fmt.Sprintf("config %q is not found", name)), } } for k, v := range cfgs { diff --git a/config/local.go b/config/local.go index 1df8e6d..a40faea 100644 --- a/config/local.go +++ b/config/local.go @@ -35,7 +35,7 @@ func (svc localConfigsSVC) CreateConfig(cfg Config) (Config, error) { if cfg.Name == "" { return Config{}, &api.Error{ Code: api.ERRORCODE_INVALID, - Message: "config name is empty", + Message: api.PtrString("config name is empty"), } } cfgs, err := svc.ListConfigs() @@ -45,7 +45,7 @@ func (svc localConfigsSVC) CreateConfig(cfg Config) (Config, error) { if _, ok := cfgs[cfg.Name]; ok { return Config{}, &api.Error{ Code: api.ERRORCODE_CONFLICT, - Message: fmt.Sprintf("config %q already exists", cfg.Name), + Message: api.PtrString(fmt.Sprintf("config %q already exists", cfg.Name)), } } cfgs[cfg.Name] = cfg @@ -69,7 +69,7 @@ func (svc localConfigsSVC) DeleteConfig(name string) (Config, error) { if !ok { return Config{}, &api.Error{ Code: api.ERRORCODE_NOT_FOUND, - Message: fmt.Sprintf("config %q is not found", name), + Message: api.PtrString(fmt.Sprintf("config %q is not found", name)), } } delete(cfgs, name) @@ -119,7 +119,7 @@ func (svc localConfigsSVC) UpdateConfig(up Config) (Config, error) { if !ok { return Config{}, &api.Error{ Code: api.ERRORCODE_NOT_FOUND, - Message: fmt.Sprintf("config %q is not found", up.Name), + Message: api.PtrString(fmt.Sprintf("config %q is not found", up.Name)), } } if up.Token != "" { @@ -209,7 +209,7 @@ func blockBadName(cfgs Configs) error { if _, ok := badNames[n]; ok { return &api.Error{ Code: api.ERRORCODE_INVALID, - Message: fmt.Sprintf("%q is not a valid config name", n), + Message: api.PtrString(fmt.Sprintf("%q is not a valid config name", n)), } } } @@ -238,7 +238,7 @@ func (s baseRW) parseActiveConfig(currentOrPrevious bool) (Config, error) { } else if check { return DefaultConfig, &api.Error{ Code: api.ERRORCODE_CONFLICT, - Message: fmt.Sprintf("more than one %s activated configs found", previousText), + Message: api.PtrString(fmt.Sprintf("more than one %s activated configs found", previousText)), } } } @@ -247,7 +247,7 @@ func (s baseRW) parseActiveConfig(currentOrPrevious bool) (Config, error) { } return DefaultConfig, &api.Error{ Code: api.ERRORCODE_NOT_FOUND, - Message: fmt.Sprintf("%s activated config is not found", previousText), + Message: api.PtrString(fmt.Sprintf("%s activated config is not found", previousText)), } }