config

package
v0.0.0-...-ad3a29e Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Profile string `yaml:"profile,omitempty"`

	Profiles  map[string]Profile `yaml:"profiles,omitempty"`
	Instances InstanceConfig     `yaml:"instances,omitempty"`
	SSH       SSHConfig          `yaml:"ssh,omitempty"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default, minimal config.

func (Config) CurrentProfile

func (c Config) CurrentProfile() (*Profile, bool)

type InstanceConfig

type InstanceConfig struct {
	Presets map[string]InstancePreset `yaml:"presets,omitempty"`

	AutoAuthorizeMe bool `yaml:"auto_authorize_me,omitempty"`
}

type InstanceInterface

type InstanceInterface struct {
	IPAMAddress string                          `yaml:"ipam_address,omitempty"`
	Label       string                          `yaml:"label,omitempty"`
	Purpose     linodego.ConfigInterfacePurpose `yaml:"purpose,omitempty"`
}

type InstancePreset

type InstancePreset struct {
	AuthorizedUsers []string                       `yaml:"autorized_users,omitempty"`
	Group           string                         `yaml:"group,omitempty"`
	Image           string                         `yaml:"image,omitempty"`
	Interfaces      []map[string]InstanceInterface `yaml:"interfaces,omitempty"`
	Region          string                         `yaml:"region,omitempty"`
	RootPass        string                         `yaml:"root_pass,omitempty"`
	StackscriptData map[string]interface{}         `yaml:"stackscript_data,omitempty"`
	StackscriptID   int                            `yaml:"stackscript_id,omitempty"`
	SwapSize        int                            `yaml:"swap_size,omitempty"`
	Tags            []string                       `yaml:"tags,omitempty"`
	Type            string                         `yaml:"type,omitempty"`
}

type Profile

type Profile struct {
	APIVersion string `yaml:"api_version,omitempty"`
	APIBaseURL string `yaml:"api_base_url,omitempty"`
	Region     string `yaml:"region,omitempty"`
	Token      string `yaml:"token,omitempty"`
}

type Provider

type Provider interface {
	Load() (*Config, error)
	Save(config *Config) error
}

Provider manages the config file.

func NewProvider

func NewProvider() Provider

NewProvider builds a new config provider.

type SSHConfig

type SSHConfig struct {
	User    string `yaml:"user,omitempty"`
	KeyPath string `yaml:"key_path,omitempty"`
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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