state

package
v0.0.0-...-5510d5e Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWorkDir

func CreateWorkDir(path string) (string, error)

func ValidateExtName

func ValidateExtName(file string) error

Types

type Cert

type Cert struct {
	Status string `json:"status"`
	Path   string `json:"path"`
}

type Hosts

type Hosts struct {
	KeyPair KeyPair   `json:"key"`
	Servers []*Server `json:"servers"`
}

type KeyPair

type KeyPair struct {
	Name   string `json:"name"`
	Status string `json:"status"` // automatically generated
}

type Network

type Network struct {
	Name    string     `json:"name"`
	Range   string     `json:"range"`
	Subnets []Subnet   `json:"subnets"`
	Vpn     VpnGateway `json:"vpn_gateway"`
}

type Parser

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

func NewParser

func NewParser(workDir, path string) (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse() (*State, error)

type Provider

type Provider struct {
	Name    string `json:"name"`
	Profile string `json:"profile"`
	Region  string `json:"region"`
}

type Route

type Route struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type Server

type Server struct {
	Name    string       `json:"name"`
	Size    string       `json:"size"`
	Number  int          `json:"number"` // default 1
	Subnet  string       `json:"subnet"`
	Address []string     `json:"address"`
	Image   *ServerImage `json:"image"`
	Status  string       `json:"status"` // automatically generated
	Ports   []int        `json:"ports"`
}

type ServerImage

type ServerImage struct {
	Custom         bool     `json:"custom"`
	Id             string   `json:"id"`
	Status         string   `json:"status"`
	ImagePath      string   `json:"image_path"`
	BaseImage      string   `json:"base_image"`
	LoginUser      string   `json:"login_user,omitempty"`
	Architecture   string   `json:"architecture"`
	AwsImageOwner  string   `json:"aws_image_owner,omitempty"`
	ScriptFilePath []string `json:"scripts"`
	InlineScripts  []string `json:"inline"`
}

type Service

type Service struct {
	Name    string   `json:"name"`
	Storage *Storage `json:"storage"`
	Network *Network `json:"network"`
	Hosts   *Hosts   `json:"hosts"`
}

type State

type State struct {
	WorkDir  string
	Provider Provider `json:"provider"`
	Service  Service  `json:"service"`
}

func (*State) CreateState

func (s *State) CreateState() error

type Storage

type Storage struct {
	Id string `json:"id"`
}

type Subnet

type Subnet struct {
	Name                 string  `json:"name"`
	Range                string  `json:"range"`
	Private              bool    `json:"private"`
	VpnGatewayAssociated bool    `json:"vpn_gateway_associated"`
	Routes               []Route `json:"routes"`
}

type VpnGateway

type VpnGateway struct {
	Id               string `json:"id"`
	Range            string `json:"range"`
	Domain           string `json:"domain"`
	AssociatedSubnet string `json:"associated_subnet"` // TODO 重複してる
	Cert             Cert   `json:"cert"`
}

Jump to

Keyboard shortcuts

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