models

package
v0.0.0-...-509512d Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGeneric               = errors.New("something went wrong, check that the data in the config.yaml is correct")
	ErrInvalidProvider       = errors.New("invalid provider")
	ErrInvalidToken          = errors.New("invalid token")
	ErrInvalidImage          = errors.New("invalid image")
	ErrInvalidRegion         = errors.New("invalid region")
	ErrInvalidSize           = errors.New("invalid size")
	ErrInvalidPort           = errors.New("invalid port")
	ErrInvalidSshFile        = errors.New("invalid SSH file")
	ErrBoxNotFound           = errors.New("box not found")
	ErrNotAvailableCustomVps = errors.New("command not available with custom vps")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Providers map[string]Provider `json:"providers"`
	CustomVMs []CustomVM          `json:"custom_vms"`
	SSHKeys   SSHKeys             `json:"ssh_keys"`
	Settings  Settings            `json:"settings"`
}

type CustomVM

type CustomVM struct {
	Provider   string   `json:"provider"`
	InstanceID string   `json:"instance_id"`
	PublicIP   string   `json:"public_ip"`
	SSHPort    int      `json:"ssh_port"`
	Username   string   `json:"username"`
	Password   string   `json:"password"`
	KeyPath    string   `json:"key_path"`
	Tags       []string `json:"tags"`
}

type Module

type Module struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Author      string            `yaml:"author"`
	Vars        map[string]string `yaml:"vars"`
	Commands    []string          `yaml:"commands"`
}

type Provider

type Provider struct {
	Token    string   `json:"token,omitempty"`
	Region   string   `json:"region,omitempty"`
	Size     string   `json:"size,omitempty"`
	Image    string   `json:"image,omitempty"`
	Port     int      `json:"port,omitempty"`
	Username string   `json:"username,omitempty"`
	Password string   `json:"password,omitempty"`
	Tags     []string `json:"tags,omitempty"`
}

type SSHKeys

type SSHKeys struct {
	PublicFile  string `json:"public_file"`
	PrivateFile string `json:"private_file"`
}

type Settings

type Settings struct {
	Provider string `json:"provider"`
}

type VMInfo

type VMInfo struct {
	Provider string
	IP       string
	Port     int
	Username string
	Password string
	KeyPath  string
}

func GetVMInfo

func GetVMInfo(provider, name string, config *Config) *VMInfo

Jump to

Keyboard shortcuts

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