node

package
v2.0.0-rc.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatePlanned      NodeState = "planned"
	StateBuilding     NodeState = "building"
	StateProvisioning NodeState = "provisioning"
	StateError        NodeState = "error"
	StateActive       NodeState = "active"
	StateDeleting     NodeState = "deleting"

	RoleMaster Role = "master"
	RoleNode   Role = "node"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID        string      `json:"id" valid:"required"`
	TaskID    string      `json:"taskId"`
	Role      Role        `json:"role"`
	CreatedAt int64       `json:"createdAt" valid:"required"`
	Provider  clouds.Name `json:"provider" valid:"required"`
	Region    string      `json:"region" valid:"required"`

	Size      string    `json:"size"`
	PublicIp  string    `json:"publicIp"`
	PrivateIp string    `json:"privateIp"`
	State     NodeState `json:"state"`
	Name      string    `json:"name"`
	// contains filtered or unexported fields
}

TODO(stgleb): Accommodate terminology and rename Node to Machine

func (Node) String

func (n Node) String() string

type NodeState

type NodeState string

type Role

type Role string

type Service

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

Service contains business logic for node in particular cloud provider

func NewService

func NewService(prefix string, s storage.Interface) *Service

NewService constructs a Service.

func (*Service) Create

func (s *Service) Create(ctx context.Context, node *Node) error

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, nodeId string) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, nodeId string) (*Node, error)

func (*Service) ListAll

func (s *Service) ListAll(ctx context.Context) ([]Node, error)

Jump to

Keyboard shortcuts

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