cmdconfig

package
v1.8.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

type Config

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

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

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

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

func NewConfig

func NewConfig(cfgPath string, fs afero.Fs, p common.Prompter) (*Config, error)

func NewEmptyConfig added in v1.8.11

func NewEmptyConfig(fs afero.Fs, p common.Prompter) (*Config, error)

func (*Config) CreateContext added in v1.6.1

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

func (*Config) CreateContextAndSave added in v1.8.13

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

func (*Config) DeleteContext added in v1.6.1

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

func (*Config) GetContext added in v1.8.13

func (cfg *Config) GetContext(name string) *Context

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) PromptForContext added in v1.8.10

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

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 `json:"name" yaml:"name"`
	ServiceName   string `json:"service" yaml:"service"`
	ProjectID     string `json:"project_id" yaml:"project_id"`
	EnvironmentID string `json:"environment_id" 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 `json:"name,omitempty"`
	Server string `json:"server,omitempty"`
}

type User

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

Jump to

Keyboard shortcuts

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