@@ -45,7 +45,8 @@ const (
4545 DEFAULT = "default"
4646)
4747
48- const DEFAULT_ACS_API_ENDPOINT = "http://localhost:8080/client/api"
48+ // DefaultACSAPIEndpoint is the default API endpoint for CloudStack.
49+ const DefaultACSAPIEndpoint = "http://localhost:8080/client/api"
4950
5051// ServerProfile describes a management server
5152type ServerProfile struct {
@@ -84,10 +85,12 @@ type Config struct {
8485 C chan bool
8586}
8687
88+ // GetOutputFormats returns the supported output formats.
8789func GetOutputFormats () []string {
8890 return []string {"column" , "csv" , "json" , "table" , "text" , "default" }
8991}
9092
93+ // CheckIfValuePresent checks if an element is present in the dataset.
9194func CheckIfValuePresent (dataset []string , element string ) bool {
9295 for _ , arg := range dataset {
9396 if arg == element {
@@ -158,7 +161,7 @@ func defaultCoreConfig() Core {
158161
159162func defaultProfile () ServerProfile {
160163 return ServerProfile {
161- URL : DEFAULT_ACS_API_ENDPOINT ,
164+ URL : DefaultACSAPIEndpoint ,
162165 Username : "admin" ,
163166 Password : "password" ,
164167 Domain : "/" ,
@@ -189,6 +192,7 @@ func GetProfiles() []string {
189192 return profiles
190193}
191194
195+ // SetupContext initializes the context and signal handling for the config.
192196func SetupContext (cfg * Config ) {
193197 cfg .C = make (chan bool )
194198 signals := make (chan os.Signal , 1 )
0 commit comments