Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AUTHENTICATION_FAILURE = 401
View Source
var AUTH_FAILURE_ERROR_MESSAGE = "" /* 141-byte string literal not displayed */
View Source
var CLI_ARCH = "NA"
View Source
var CLI_BUILD_NUMBER = "NA"
View Source
var CLI_BUILD_TIME = "NA"
View Source
var CLI_DIR_DEFAULT_LOCATION = filepath.Join(PARALUS_DIR_DEFAULT_LOCATION, "cli")
View Source
var CLI_MISMATCH_ERROR_MESSAGE = "" /* 126-byte string literal not displayed */
View Source
var CLI_VERSION = "1.0"
View Source
var CONFIG_API_VERSION = "1.0"
View Source
var CONFIG_FILE_DEFAULT_NAME = "config"
View Source
var CONFIG_FLAG_NAME = "config"
View Source
var GENERIC_ERROR_MESSAGE = "CLI faced an issue while running the command %s. Please use -v flag to see debug logs."
View Source
var LOG_FILE_DEFAULT_NAME = "cli.log"
View Source
var PARALUS_DIR_DEFAULT_LOCATION = filepath.Join(utils.GetUserHome(), ".paralus")
View Source
var PROFILE_FLAG_NAME = "profile"
View Source
var REQUEST_SUCCESSFUL = 200
View Source
var VERBOSE_FLAG_NAME = "verbose"
View Source
var WORKLOAD_CREATED = 201
View Source
var WP_API_VERSION = "1.0"

Functions

func GetProjectIdByName

func GetProjectIdByName(name string) (string, error)

func GetProjectIdByNameInConfig

func GetProjectIdByNameInConfig(config *Config, name string) (string, error)

func GetProjectIdFromFlag

func GetProjectIdFromFlag(cmd *cobra.Command) (string, error)

func GetProjectIdFromFlagAndConfig

func GetProjectIdFromFlagAndConfig(cmd *cobra.Command) (string, error)

func GetProjectNameById

func GetProjectNameById(partner, organization, id string) (string, error)

func GetProjectNameFromFlagAndConfig

func GetProjectNameFromFlagAndConfig(cmd *cobra.Command) (string, error)

func GetV3Context

func GetV3Context(cmd *cobra.Command) context.Context

func InitConfig

func InitConfig(ctx *context.CliContext) error

Types

type Config

type Config struct {
	Profile             string `json:"profile,omitempty"`
	SkipServerCertValid string `json:"skip_server_cert_check,omitempty"`
	RESTEndpoint        string `json:"rest_endpoint,omitempty"`
	OPSEndpoint         string `json:"ops_endpoint,omitempty"`
	APIKey              string `json:"api_key,omitempty"`
	APISecret           string `json:"api_secret,omitempty"`
	Partner             string `json:"partner,omitempty"`
	Organization        string `json:"organization,omitempty"`
	Project             string `json:"project,omitempty"`
}

func GetConfig

func GetConfig() *Config

func NewDefaultConfig

func NewDefaultConfig(profile string) *Config

func NewOpDevConfig

func NewOpDevConfig() *Config

func NewProductionConfig

func NewProductionConfig() *Config

func NewStageConfig

func NewStageConfig() *Config

func (*Config) DLog

func (c *Config) DLog(title string)

func (*Config) GetAppAuthProfile

func (c *Config) GetAppAuthProfile() *authprofile.Profile

func (*Config) GetOpsAuthProfile

func (c *Config) GetOpsAuthProfile() *authprofile.Profile

func (*Config) Load

func (c *Config) Load(filename string) error

func (*Config) Log

func (c *Config) Log(title string)

func (*Config) MiniCheck

func (c *Config) MiniCheck() error

func (*Config) OpenAPIAuthInfo

func (c *Config) OpenAPIAuthInfo() oruntime.ClientAuthInfoWriter

func (*Config) Output

func (c *Config) Output()

func (*Config) Save

func (c *Config) Save(filename string) error

func (*Config) Write

func (c *Config) Write(w io.Writer)

func (*Config) WriteReadable

func (c *Config) WriteReadable(w io.Writer)

type ConfigTracker

type ConfigTracker struct {
	Config
	Source Config `json:"source"`
}

func GetConfigTracker

func GetConfigTracker() *ConfigTracker

func (*ConfigTracker) Merge

func (c *ConfigTracker) Merge(b *Config, source string, override bool)

Return the merged context *b into the *c. When a field in *c is not defined, it is merged in from *b.

func (*ConfigTracker) Output

func (t *ConfigTracker) Output()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL