config

package
v0.0.0-...-725038a Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextLoader

type ContextLoader struct{}

func NewContextLoader

func NewContextLoader() ContextLoader

func (ContextLoader) Load

func (ContextLoader) Load(
	context string,
	configFilePath string,
) (*userconfig.Config, error)

type ErrContextNotFound

type ErrContextNotFound struct {
	Context        string
	ConfigFilePath string
}

ErrContextNotFound represents the error returned when the context passed in option was not found.

func (ErrContextNotFound) Error

func (ErrContextNotFound) Error() string

type ErrInvalidAPIToken

type ErrInvalidAPIToken struct {
	APIToken string
}

ErrInvalidAPIToken represents the error returned when the API token in user config is invalid.

func (ErrInvalidAPIToken) Error

func (ErrInvalidAPIToken) Error() string

type ErrInvalidRegion

type ErrInvalidRegion struct {
	Region string
}

ErrInvalidRegion represents the error returned when the region in user config is invalid.

func (ErrInvalidRegion) Error

func (ErrInvalidRegion) Error() string

type TOMLConfig

type TOMLConfig struct {
	ActiveContext string              `toml:"active_context,omitempty"`
	Contexts      []TOMLConfigContext `toml:"contexts"`
}

type TOMLConfigContext

type TOMLConfigContext struct {
	Name  string `toml:"name"`
	Token string `toml:"token"`
}

type UserConfigValidator

type UserConfigValidator struct{}

func NewUserConfigValidator

func NewUserConfigValidator() UserConfigValidator

func (UserConfigValidator) Validate

func (u UserConfigValidator) Validate(userConfig *userconfig.Config) error

Jump to

Keyboard shortcuts

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