core

package
v0.0.0-...-08f6c10 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetImage = "ubuntu-20.04"

	// Most Stable, Reliable and Cheapest
	// Location by Hetzner
	TargetLocation = "nbg1"
)

Change this if needed in the future when Hetzner deprecates Ubuntu 20.04 LTS, or if it is that time of the year.

Variables

This section is empty.

Functions

func CreateServer

func CreateServer(client *hcloud.Client, server *hcloud.ServerType, serverName string) (*hcloud.Server, error)

func WriteConfiguration

func WriteConfiguration(config Configuration) error

Types

type Configuration

type Configuration struct {
	APIKey        string
	SSHPublicKey  string
	SSHPrivateKey string
}

func GetConfiguration

func GetConfiguration() (Configuration, error)

func NewConfiguration

func NewConfiguration(Key string, SSHPubKey string, SSHPrivKey string) Configuration

type HAMFile

type HAMFile struct {
	Title     string `yaml:"title"`
	Version   string `yaml:"version"`
	SHA256Sum string
	Args      []struct {
		ID       string `yaml:"id"`
		Prompt   string `yaml:"prompt"`
		Required *bool  `yaml:"required",omitempty`
		Type     string `yaml:"type"`
	}

	Build []struct {
		Title string `yaml:"name"`
		Cmd   string `yaml:"run"`
	}

	PostBuild []string `yaml:"post_build"`
}

func NewHAMFile

func NewHAMFile(RecipePath string) (HAMFile, error)

type Variable

type Variable struct {
	Value string
	Type  VariableType
}

type VariableType

type VariableType int
const (
	VARIABLE_TYPE_VALUE VariableType = iota
	VARIABLE_TYPE_FILE_PATH
	VARIABLE_TYPE_SECRET
)

type Variables

type Variables struct {
	Vars map[string]Variable
}

func NewVariables

func NewVariables() *Variables

func (*Variables) GetVar

func (ctx *Variables) GetVar(key string) Variable

func (*Variables) PutVar

func (ctx *Variables) PutVar(key string, value string, ty VariableType)

Jump to

Keyboard shortcuts

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