cmdconfig

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromptForContext added in v1.7.0

func PromptForContext(cfg *Config) (string, error)

Types

type Auth

type Auth struct {
	UserID       string `yaml:"user_id,omitempty"`
	AccessToken  string `yaml:"access_token,omitempty"`
	RefreshToken string `yaml:"refresh_token,omitempty"`
}

type Config

type Config struct {
	Contexts []*Context `yaml:"contexts"`

	Services []*Service `yaml:"services"`

	Users []*User `yaml:"users"`

	CurrentContextName string `yaml:"current_context"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(cfgPath string) (*Config, error)

func (*Config) CreateContext added in v1.6.1

func (cfg *Config) CreateContext(name, host string, interactive bool) error

func (*Config) CreateContextNoPrompt added in v1.7.3

func (cfg *Config) CreateContextNoPrompt(name, url string) error

func (*Config) CreateDefaultContext added in v1.6.1

func (cfg *Config) CreateDefaultContext(interactive bool) error

func (*Config) DeleteContext added in v1.6.1

func (cfg *Config) DeleteContext(name string) bool

func (*Config) GetCurrentAuth

func (cfg *Config) GetCurrentAuth() *Auth

func (*Config) GetCurrentContext

func (cfg *Config) GetCurrentContext() *Context

func (*Config) GetCurrentService

func (cfg *Config) GetCurrentService() *Service

func (*Config) GetEnvironment added in v1.6.0

func (cfg *Config) GetEnvironment() string

func (*Config) GetProject added in v1.5.3

func (cfg *Config) GetProject() string

func (*Config) GetService added in v1.7.0

func (cfg *Config) GetService(name string) (*Service, error)

func (*Config) GetUser added in v1.7.0

func (cfg *Config) GetUser(name string) (*User, error)

func (*Config) Minify added in v1.7.0

func (cfg *Config) Minify() *Config

func (Config) Save

func (cfg Config) Save() error

func (*Config) SelectContext added in v1.6.1

func (cfg *Config) SelectContext() error

func (*Config) UseContext added in v1.6.1

func (cfg *Config) UseContext(name string) error

type Context

type Context struct {
	Name          string `yaml:"name"`
	ServiceName   string `yaml:"service"`
	ProjectID     string `yaml:"project_id"`
	EnvironmentID string `yaml:"environment_id"`
	// contains filtered or unexported fields
}

func (*Context) GetAuth

func (c *Context) GetAuth() *Auth

func (*Context) GetService

func (c *Context) GetService() *Service

func (*Context) SetAuth

func (c *Context) SetAuth(a *Auth)

func (*Context) SetService

func (c *Context) SetService(s *Service)

type Service

type Service struct {
	Name   string `yaml:"name,omitempty"`
	Server string `yaml:"server,omitempty"`
}

type User

type User struct {
	Name string `yaml:"name,omitempty"`
	Auth *Auth  `yaml:"auth,omitempty"`
}

Jump to

Keyboard shortcuts

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