spt

package module
v0.0.0-...-57e2522 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 10 Imported by: 0

README

Go Reference

spt(1)

Usage:
  spt provision
  spt run
  spt self
  spt attach
  spt validate

Options:
  -h, --help  Show this screen.
  -c, --config  Configuration file [default: spt.toml]
  -d, --detach  Detach local client
  --delete  Deprovision device
  --id  Device ID

spt

See example/ for example usage and configuration.

Example configuration

# spt.toml

[project]
name = "example"

[service.equinix]
project = "EQUINIX_PROJECT"
api_key = "EQUINIX_API_KEY"
spot_price_max = 0.2
plan = "m3.small.x86"
os = "ubuntu_22_04"

[build.args]
passthrough = ["BUILD_ARG_1"]

[run.env]
passthrough = ["RUN_ENV_1"]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(format string, args ...interface{})

Types

type Build

type Build struct {
	Args struct {
		Passthrough []string
	}
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg Config) Client

func (*Client) Attach

func (c *Client) Attach(id string) (*MetalDevice, error)

func (*Client) Provision

func (c *Client) Provision() (*MetalDevice, error)

type Config

type Config struct {
	Service Service
	Project Project
	Build   Build
	Run     Run
}

type DeviceCreator

type DeviceCreator interface {
	SetPlan(string)
	SetOperatingSystem(string)
	SetHostname(string)
	SetUserdata(string)
	SetTags([]string)
	SetHardwareReservationId(string)
	SetBillingCycle(metalv1.DeviceCreateInputBillingCycle)
	SetSpotInstance(bool)
	SetSpotPriceMax(float32)
	SetTerminationTime(time.Time)
	SetCustomdata(map[string]interface{})
}

type Metadata

type Metadata struct {
	Customdata struct {
		ApiKey string `json:"api_key"`
	} `json:"customdata"`
	Id string `json:"id"`
}

type MetalDevice

type MetalDevice struct {
	// contains filtered or unexported fields
}

func NewSelfDevice

func NewSelfDevice() *MetalDevice

func (*MetalDevice) Delete

func (c *MetalDevice) Delete()

func (*MetalDevice) Run

func (c *MetalDevice) Run(detach bool, args []string)

type OneOfDeviceCreator

type OneOfDeviceCreator interface {
	DeviceCreator
	GetActualInstance() interface{}
}

type Project

type Project struct {
	Name string
}

type Run

type Run struct {
	Env struct {
		Passthrough []string
	}
}

type Service

type Service struct {
	Equinix struct {
		Project         string
		ApiKey          string  `toml:"api_key"`
		SpotPriceMax    float32 `toml:"spot_price_max"`
		Plan            string
		OperatingSystem string `toml:"os"`
	}
}

Directories

Path Synopsis
cmd
spt

Jump to

Keyboard shortcuts

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