a480527808
Each of these include an option for --current-context that set or retrieves the curret context This patchset mainly creates the cmd/config and pkg/config require additions Also includes a fync getCurrentContext(<CLUSTERTYPE>) in the config pkg that other modules should rely on. Introduces new ErrMissingConfig and ErrConfigFailed types been used by set-context, will decimate through get/ and set/get cluster after this is reviewed. Change-Id: I501483a9db99f33f860eaf329a65bb0209b2aaff
47 lines
992 B
Go
47 lines
992 B
Go
package errors
|
|
|
|
// AirshipError is the base error type
|
|
// used to create extended error types
|
|
// in other airshipctl packages.
|
|
type AirshipError struct {
|
|
Message string
|
|
}
|
|
|
|
// Error function implments the golang
|
|
// error interface
|
|
func (ae *AirshipError) Error() string {
|
|
return ae.Message
|
|
}
|
|
|
|
// ErrNotImplemented returned for not implemented features
|
|
type ErrNotImplemented struct {
|
|
}
|
|
|
|
func (e ErrNotImplemented) Error() string {
|
|
return "Not implemented"
|
|
}
|
|
|
|
// ErrWrongConfig returned in case of incorrect configuration
|
|
type ErrWrongConfig struct {
|
|
}
|
|
|
|
func (e ErrWrongConfig) Error() string {
|
|
return "Wrong configuration"
|
|
}
|
|
|
|
// ErrMissingConfig returned in case of missing configuration
|
|
type ErrMissingConfig struct {
|
|
}
|
|
|
|
func (e ErrMissingConfig) Error() string {
|
|
return "Missing configuration"
|
|
}
|
|
|
|
// ErrConfigFailed returned in case of failure during configuration
|
|
type ErrConfigFailed struct {
|
|
}
|
|
|
|
func (e ErrConfigFailed) Error() string {
|
|
return "Configuration failed to complete."
|
|
}
|