outliner

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const InstanceTag = "OUTLINER_AUTO_SETUP"

InstanceTag instance create by outliner should have this tag

View Source
const SSHKeyName = "OUTLINER_AUTO_SSH"

SSHKeyName ssh keys name in cloud

Variables

This section is empty.

Functions

This section is empty.

Types

type APICert

type APICert struct {
	APIurl     string `json:"apiUrl"`
	CertSha256 string `json:"certSha256"`
}

APICert info about VPN service on instance

type Activator

type Activator interface {
	ListTokenName() []string     // list Token names for register
	VerifyToken(string) bool     // verify api key & availability
	GenProvider(string) Provider // Gen a Provider
}

Activator object before generate a Provider

type Agent

type Agent interface {
	GetCredentialPub() string
	Deploy(string) error
	Watch(string) error
	GetServiceCert(string) (APICert, error)
}

Agent defin deply Agent methods

type Cloud

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

Cloud core object for outliner

func NewCloud

func NewCloud() *Cloud

NewCloud generate new cloud

func (*Cloud) CreateInstance

func (c *Cloud) CreateInstance(in Instance) (Instance, error)

CreateInstance create a instance on server Provider

func (*Cloud) DestroyInstance

func (c *Cloud) DestroyInstance(ID string) error

DestroyInstance destroy a instanceon server Provider

func (*Cloud) InspectInstanceByID added in v0.2.0

func (c *Cloud) InspectInstanceByID(ID string) (Instance, error)

InspectInstanceByID Inspect Instance

func (*Cloud) InspectInstanceByIP added in v0.2.0

func (c *Cloud) InspectInstanceByIP(IP string) (Instance, error)

InspectInstanceByIP Inspect Instance

func (*Cloud) ListInstance

func (c *Cloud) ListInstance() ([]Instance, error)

ListInstance list all instances create by outliner

func (*Cloud) ListProvider

func (c *Cloud) ListProvider() ([][]string, error)

ListProvider show avalible Providers

func (*Cloud) ListRegion

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

ListRegion show avalible Regions on Providers

func (*Cloud) ListSpec

func (c *Cloud) ListSpec() (map[string][]Spec, error)

ListSpec show avalible Specs on Providers

func (*Cloud) RegisterProvider

func (c *Cloud) RegisterProvider(validater Validater, actvrs ...Activator) error

RegisterProvider Register a cloud Provider whith Validater function

func (Cloud) WaitInstance

func (c Cloud) WaitInstance(in Instance) error

WaitInstance wait instance to boot

type Deployer

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

Deployer core object for outliner

func NewDeployer

func NewDeployer() *Deployer

NewDeployer generate new deployer

func (Deployer) DeployService

func (d Deployer) DeployService(ip string) error

DeployService deploy service

func (Deployer) GetCredentialPub

func (d Deployer) GetCredentialPub() string

GetCredentialPub Get CredentialPub

func (Deployer) GetServiceCert

func (d Deployer) GetServiceCert(ip string) (APICert, error)

GetServiceCert get service cert

func (*Deployer) RegisterAgent added in v0.2.0

func (d *Deployer) RegisterAgent(agent Agent)

RegisterAgent Register Agent to deployer

func (Deployer) WaitService

func (d Deployer) WaitService(ip string) error

WaitService wait service

type Instance

type Instance struct {
	ID       string
	Provider string
	IPv4     string
	Spec     Spec
	Region   Region
	SSHKey   string
	APICert  APICert
}

Instance info about server create on server provider

type Provider

type Provider interface {
	Name() string                              // provider's name
	GetToken() string                          // provider's verified Token
	ListSpec() ([]Spec, error)                 // list provider Instance Spec
	ListRegion() ([]Region, error)             // list provider's available regions
	ListInstance() ([]Instance, error)         // list created instance on provider
	CreateInstance(Instance) (Instance, error) // create instance on provider
	WaitInstance(Instance) error               // get info about instance and vpn
	DestroyInstance(string) error              // destroy instance on provider
}

Provider defin server provider methods

type Region

type Region struct {
	ID   string
	Note string
}

Region info about Region

type Spec

type Spec struct {
	ID       string
	Transfer string
	Price    string
}

Spec info about server sepc

type Validater

type Validater func(Activator) (Provider, error)

Validater config & verify token define valid Provider gen from Activator

Jump to

Keyboard shortcuts

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