universal

package
v0.0.0-...-1a23c2c Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFoundError error = errors.New("resource not found")
View Source
var NotImplementedError error = errors.New("resource method not implemented")

Functions

func NormalizeIdentifier

func NormalizeIdentifier(identifier string, long bool) string

NormalizeIdentifier normalizes user-provided identifiers by adapting them to the most strict cloud provider naming requisites.

Types

type Cloud

type Cloud struct {
	Timeouts
	Provider
	Region
	Tags map[string]string
}

func (*Cloud) GetClosestRegion

func (c *Cloud) GetClosestRegion(regions map[string]Region) (string, error)

type Environment

type Environment struct {
	Image     string
	Script    string
	Variables map[string]*string
	Timeout   time.Duration
	Directory string
}

func (*Environment) GenerateMachineScript

func (e *Environment) GenerateMachineScript() string

type Event

type Event struct {
	Time        time.Time
	Code        string
	Description []string
}

type Firewall

type Firewall struct {
	Ingress FirewallRule
	Egress  FirewallRule
}

Firewall

type FirewallRule

type FirewallRule struct {
	Nets  *[]net.IPNet
	Ports *[]uint16
}

Firewall rule: not specified fields mean "allow any"; sepcified but empty mean "allow none"; ports are both TCP and UDP; when ports is not specified, it will allow ingress to every port and every protocol, not only TCP&UDP

type Provider

type Provider string
const (
	ProviderAmazon     Provider = "aws"
	ProviderGoogle     Provider = "gcp"
	ProviderMicrosoft  Provider = "az"
	ProviderKubernetes Provider = "k8s"
)

type Region

type Region string

type Size

type Size struct {
	Storage int
	Machine string
}

type Status

type Status struct {
	Address net.IP
	Active  bool
}

type Storage

type Storage struct{}

type Task

type Task struct {
	Size
	Environment
	Firewall
	Spot        float64 // <0=disabled, 0=auto, >0=fixed
	Parallelism uint16
	Tags        map[string]string // Deprecated

	Addresses []net.IP
	Status    map[string]int
	Events    []Event
}

type Timeouts

type Timeouts struct {
	Create time.Duration
	Read   time.Duration
	Update time.Duration
	Delete time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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