cmd

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 42 Imported by: 0

Documentation

Index

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 GetAPIClient(config *CLIConfig) *api.Client

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

func Setup

func Setup()

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 (c *CLIConfig) SetCluster(clusterID uint) error

func (*CLIConfig) SetDriver added in v0.4.0

func (c *CLIConfig) SetDriver(driver string) error

func (*CLIConfig) SetHelmRepo added in v0.4.0

func (c *CLIConfig) SetHelmRepo(helmRepoID uint) error

func (*CLIConfig) SetHost added in v0.4.0

func (c *CLIConfig) SetHost(host string) error

func (*CLIConfig) SetProject added in v0.4.0

func (c *CLIConfig) SetProject(projectID uint) error

func (*CLIConfig) SetRegistry added in v0.4.0

func (c *CLIConfig) SetRegistry(registryID uint) error

func (*CLIConfig) SetToken added in v0.4.0

func (c *CLIConfig) SetToken(token string) error

type PorterRunSharedConfig added in v0.7.2

type PorterRunSharedConfig struct {
	Client     *api.Client
	RestConf   *rest.Config
	Clientset  *kubernetes.Clientset
	RestClient *rest.RESTClient
}

Directories

Path Synopsis
providers
aws
gcp

Jump to

Keyboard shortcuts

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