Documentation ¶
Index ¶
- Variables
- func Execute()
- func GetAPIClient(config *CLIConfig) *api.Client
- func InitAndLoadConfig()
- func Setup()
- type CLIConfig
- func (c *CLIConfig) SetCluster(clusterID uint) error
- func (c *CLIConfig) SetDriver(driver string) error
- func (c *CLIConfig) SetHelmRepo(helmRepoID uint) error
- func (c *CLIConfig) SetHost(host string) error
- func (c *CLIConfig) SetProject(projectID uint) error
- func (c *CLIConfig) SetRegistry(registryID uint) error
- func (c *CLIConfig) SetToken(token string) error
- type PorterRunSharedConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotConnect error = errors.New("Unable to connect to the Porter server.")
View Source
var ErrNotLoggedIn error = errors.New("You are not logged in.")
View Source
var Version string = "v0.8.0"
Version will be linked by an ldflag during build
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetAPIClient ¶
func InitAndLoadConfig ¶ added in v0.4.0
func InitAndLoadConfig()
InitAndLoadConfig populates the config object with the following precedence rules: 1. flag 2. env 3. config 4. default
It populates the shared config object above
Types ¶
type CLIConfig ¶ added in v0.4.0
type CLIConfig struct { // Driver can be either "docker" or "local", and represents which driver is // used to run an instance of the server. Driver string `yaml:"driver"` Host string `yaml:"host"` Project uint `yaml:"project"` Cluster uint `yaml:"cluster"` Token string `yaml:"token"` Registry uint `yaml:"registry"` HelmRepo uint `yaml:"helm_repo"` }
CLIConfig is the set of shared configuration options for the CLI commands. This config is used by viper: calling Set() function for any parameter will update the corresponding field in the viper config file.
func InitAndLoadNewConfig ¶ added in v0.4.0
func InitAndLoadNewConfig() *CLIConfig
func (*CLIConfig) SetCluster ¶ added in v0.4.0
func (*CLIConfig) SetHelmRepo ¶ added in v0.4.0
func (*CLIConfig) SetProject ¶ added in v0.4.0
func (*CLIConfig) SetRegistry ¶ added in v0.4.0
type PorterRunSharedConfig ¶ added in v0.7.2
type PorterRunSharedConfig struct {}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.