entities

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DependencyStatusNew       = "NEW"
	DependencyStatusDeploying = "DEPLOYING"
	DependencyStatusFailing   = "FAILING"
	DependencyStatusRetrying  = "RETRYING"
	DependencyStatusReady     = "READY"
	DependencyStatusWaiting   = "WAITING"
)
View Source
const (
	DeploymentStatusNew       = "NEW"
	DeploymentStatusDeploying = "DEPLOYING"
	DeploymentStatusFailing   = "FAILING"
	DeploymentStatusRetrying  = "READY"
	DeploymentStatusReady     = "READY"
)
View Source
const (
	NodeStatusNew        = "NEW"
	NodeStatusDeploying  = "DEPLOYING"
	NodeStatusActive     = "ACTIVE"
	NodeStatusReady      = "READY"
	NodeStatusFailing    = "FAILING"
	NodeStatusRetrying   = "RETRYING"
	NodeStatusRestarting = "RESTARTING"
	NodeStatusStopped    = "STOPPED"
	NodeStatusError      = "ERROR"
	NodeStatusDeleted    = "DELETED"
)
View Source
const DefaultProvider = "GLESYS"

Variables

View Source
var (
	KeyStatusNew      = "NEW"
	KeyStatusAdapting = "ADAPTING"
	KeyStatusActive   = "ACTIVE"
	KeyStatusFailing  = "FAILING"
	KeyStatusDeleted  = "DELETED"
)

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Retries int32  `json:"retries"`
}

type Deployment

type Deployment struct {
	Name    string `json:"name"`
	Url     string `json:"url"`
	Status  string `json:"status"`
	Retries int32  `json:"retries"`
}

type LubeNodeFeatures

type LubeNodeFeatures map[string]bool

type Node

type Node struct {
	ID              string           `json:"id"`
	ClusterName     string           `json:"clusterName"`
	ProviderID      string           `json:"providerId"`
	NodeToken       string           `json:"nodeToken"`
	IsMaster        bool             `json:"isMaster"`
	MasterIP        net.IP           `json:"masterIP"`
	Tags            []string         `json:"tags"`
	Name            string           `json:"name"`
	IPV4            net.IP           `json:"ipv4"`
	IPV6            net.IP           `json:"ipv6"`
	Status          string           `json:"status"`
	Retries         int              `json:"retries"`
	Error           string           `json:"error"`
	Created         time.Time        `json:"created"`
	Updated         time.Time        `json:"updated"`
	Deleted         *time.Time       `json:"deleted"`
	Features        LubeNodeFeatures `json:"features"`
	Dependencies    []Dependency     `json:"dependencies"`
	Deployments     []Deployment     `json:"deployments"`
	InstallPassword string           `json:"installPassword"`
	InstallUser     string           `json:"installUser"`
}

func (*Node) Fulfils

func (ma *Node) Fulfils(dependency string) bool

func (*Node) NeedsAdapting

func (ma *Node) NeedsAdapting() bool

func (*Node) Requires

func (ma *Node) Requires(dependency string) bool

func (*Node) Retry

func (n *Node) Retry() *Node

type Project

type Project struct {
	ProjectID string    `json:"project"`
	APIToken  string    `json:"apiToken"`
	SSHKey    *SSHKey   `json:"sshKey"`
	Nodes     []Node    `json:"nodes"`
	Created   time.Time `json:"created"`
	Updated   time.Time `json:"updated"`
	Context   string    `json:"context"`
	Provider  string    `json:"provider"`
	Reserved  bool      `json:"reserved"`
	Tags      []string  `json:"tags"`
}

func NewProject

func NewProject(opts ...ProjectOption) (*Project, error)

func ParseConfig

func ParseConfig(path string) (*Project, error)

func (*Project) FindClusterMasterNode

func (lc *Project) FindClusterMasterNode(clusterName string) *Node

func (*Project) FindNodeByID

func (lc *Project) FindNodeByID(id string) *Node

func (*Project) FindNodeByIPV4

func (lc *Project) FindNodeByIPV4(ip net.IP) *Node

func (*Project) FindNodeByName

func (lc *Project) FindNodeByName(name string) *Node

func (*Project) RemoveKey

func (lc *Project) RemoveKey(key *SSHKey) *Project

func (*Project) RemoveNode

func (lc *Project) RemoveNode(node *Node) *Project

func (*Project) Reserve added in v0.0.2

func (p *Project) Reserve() *Project

func (*Project) Tag added in v0.0.2

func (p *Project) Tag(tags ...string) *Project

func (*Project) ToJSON

func (lc *Project) ToJSON() ([]byte, error)

func (*Project) UpdateKey

func (lc *Project) UpdateKey(key *SSHKey) *Project

func (*Project) UpdateNode

func (lc *Project) UpdateNode(node *Node) *Project

func (*Project) WithAPIToken

func (cfg *Project) WithAPIToken(apiToken string) *Project

func (*Project) WithProvider

func (cfg *Project) WithProvider(provider string) *Project

func (*Project) WriteJSON

func (lc *Project) WriteJSON(w io.Writer) error

type ProjectOption

type ProjectOption func(config *Project) *Project

func WithID

func WithID(projectId string) ProjectOption

func WithName

func WithName(projectId string) ProjectOption

func WithProviderToken

func WithProviderToken(token string) ProjectOption

type SSHKey

type SSHKey struct {
	ID          string    `json:"id""`
	ProviderID  string    `json:"providerId"`
	Name        string    `json:"name"`
	Status      string    `json:"status"`
	Fingerprint string    `json:"fingerprint"`
	Error       string    `json:"error"`
	PrivateKey  string    `json:"privateKey"`
	PublicKey   string    `json:"publicKey"`
	Created     time.Time `json:"created"`
	Updated     time.Time `json:"updated"`
}

func GetPublicKeys

func GetPublicKeys() (*SSHKey, *rsa.PrivateKey, error)

func (*SSHKey) NeedsAdapting

func (k *SSHKey) NeedsAdapting() bool

Jump to

Keyboard shortcuts

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