cluster

package
v0.7.9-rc12 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInsufficientCapacity is the new error when capacity is insufficient
	ErrInsufficientCapacity = errors.New("insufficient capacity")
)
View Source
var ErrNoDeployments = errors.New("no deployments")

ErrNoDeployments indicates no deployments exist

View Source
var ErrNotRunning = errors.New("not running")

ErrNotRunning is the error when service is not running

Functions

This section is empty.

Types

type Client added in v0.0.8

type Client interface {
	ReadClient
	Deploy(context.Context, mtypes.LeaseID, *manifest.Group) error
	TeardownLease(context.Context, mtypes.LeaseID) error
	Deployments(context.Context) ([]Deployment, error)
	Inventory(context.Context) ([]Node, error)
}

Client interface lease and deployment methods

func NullClient added in v0.0.8

func NullClient() Client

NullClient returns nullClient instance

type Cluster

type Cluster interface {
	Reserve(mtypes.OrderID, atypes.ResourceGroup) (Reservation, error)
	Unreserve(mtypes.OrderID, atypes.ResourceGroup) error
}

Cluster is the interface that wraps Reserve and Unreserve methods

type Deployment added in v0.0.9

type Deployment interface {
	LeaseID() mtypes.LeaseID
	ManifestGroup() manifest.Group
}

Deployment interface defined with LeaseID and ManifestGroup methods

type InventoryStatus added in v0.6.0

type InventoryStatus struct {
	Active    []atypes.Unit `json:"active"`
	Pending   []atypes.Unit `json:"pending"`
	Available []atypes.Unit `json:"available"`
}

InventoryStatus stores active, pending and available units

type LeaseStatus added in v0.6.0

type LeaseStatus struct {
	Services []*ServiceStatus `json:"services"`
}

LeaseStatus includes list of services with their status

type Node added in v0.2.4

type Node interface {
	ID() string
	Available() atypes.Unit
}

Node interface predefined with ID and Available methods

func NewNode added in v0.2.4

func NewNode(id string, available atypes.Unit) Node

NewNode returns new Node instance with provided details

type ReadClient added in v0.7.3

type ReadClient interface {
	LeaseStatus(context.Context, mtypes.LeaseID) (*LeaseStatus, error)
	ServiceStatus(context.Context, mtypes.LeaseID, string) (*ServiceStatus, error)
	ServiceLogs(context.Context, mtypes.LeaseID, string, bool, *int64) ([]*ServiceLog, error)
}

type Reservation

type Reservation interface {
	OrderID() mtypes.OrderID
	Resources() atypes.ResourceGroup
}

Reservation interface implements orders and resources

type Service

type Service interface {
	StatusClient
	Cluster
	Close() error
	Ready() <-chan struct{}
	Done() <-chan struct{}
}

Service manage compute cluster for the provider. Will eventually integrate with kubernetes, etc...

func NewService

func NewService(ctx context.Context, session session.Session, bus pubsub.Bus, client Client) (Service, error)

NewService returns new Service instance

type ServiceLog added in v0.2.2

type ServiceLog struct {
	Name    string
	Stream  io.ReadCloser
	Scanner *bufio.Scanner
}

ServiceLog stores name, stream and scanner

func NewServiceLog added in v0.2.2

func NewServiceLog(name string, stream io.ReadCloser) *ServiceLog

NewServiceLog creates and returns a service log with provided details

type ServiceStatus added in v0.6.0

type ServiceStatus struct {
	Name      string   `json:"name"`
	Available int32    `json:"available"`
	Total     int32    `json:"total"`
	URIs      []string `json:"uris"`

	ObservedGeneration int64 `json:"observed-generation"`
	Replicas           int32 `json:"replicas"`
	UpdatedReplicas    int32 `json:"updated-replicas"`
	ReadyReplicas      int32 `json:"ready-replicas"`
	AvailableReplicas  int32 `json:"available-replicas"`
}

ServiceStatus stores the current status of service

type Status added in v0.6.0

type Status struct {
	Leases    uint32          `json:"leases"`
	Inventory InventoryStatus `json:"inventory"`
}

Status stores current leases and inventory statuses

type StatusClient added in v0.3.4

type StatusClient interface {
	Status(context.Context) (*Status, error)
}

StatusClient is the interface which includes status of service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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