Documentation
¶
Index ¶
- Constants
- Variables
- type GormNetIPNet
- type Machine
- type MachineDesiredState
- type MachineSpec
- type MachineState
- type NetworkInterface
- type NetworkProvider
- type NodeCreateMachineOptions
- type NodeServerConfig
- type NodeService
- type NodeUpdateMachineDesiredStateOptions
- type RuntimeCreateOptions
- type RuntimeProvider
- type Volume
- type VolumeProvider
Constants ¶
View Source
const ( MachineStatePending MachineState = "pending" MachineStateStarting MachineState = "starting" MachineStateRunning MachineState = "running" MachineStateDegraded MachineState = "degraded" MachineStateError MachineState = "error" MachineStateTerminating MachineState = "terminating" MachineStateTerminated MachineState = "terminated" MachineDesiredStatePending MachineDesiredState = "pending" MachineDesiredStateRunning MachineDesiredState = "running" MachineDesiredStateTerminated MachineDesiredState = "terminated" )
Variables ¶
View Source
var ErrMachineNotFound = errors.New("machine not found")
View Source
var ErrNetworkInterfaceNotFound = errors.New("network interface not found")
Functions ¶
This section is empty.
Types ¶
type GormNetIPNet ¶
func (*GormNetIPNet) GormDataType ¶
func (*GormNetIPNet) GormDataType() string
func (*GormNetIPNet) Scan ¶
func (v *GormNetIPNet) Scan(value interface{}) error
type Machine ¶
type Machine struct {
ID string `gorm:"primaryKey"`
State MachineState
DesiredState MachineDesiredState
RuntimePID *int `gorm:"column:runtime_pid"`
Spec *MachineSpec
Volume *Volume
NetworkInterface *NetworkInterface
CreatedAt time.Time
TerminatedAt *time.Time
}
type MachineDesiredState ¶
type MachineDesiredState string
type MachineSpec ¶
type MachineSpec struct {
Image string
Cpus uint32
MemoryMB uint64
Env map[string]string
User string
WorkingDir string
Command []string
}
func (*MachineSpec) GormDataType ¶
func (*MachineSpec) GormDataType() string
func (*MachineSpec) Scan ¶
func (s *MachineSpec) Scan(value interface{}) error
type MachineState ¶
type MachineState string
func (MachineState) MatchDesiredState ¶
func (s MachineState) MatchDesiredState(desired MachineDesiredState) bool
type NetworkInterface ¶
type NetworkInterface struct {
ID string `gorm:"primaryKey"`
Name string
MachineID *string
IPAddress net.IP `gorm:"type:text"`
MacAddress net.HardwareAddr `gorm:"type:text"`
GatewayAddress net.IP `gorm:"type:text"`
NetworkCIDR *GormNetIPNet `gorm:"column:network_cidr"`
CreatedAt time.Time
DeletedAt *time.Time
}
type NetworkProvider ¶
type NodeCreateMachineOptions ¶
type NodeCreateMachineOptions struct {
MachineID string
DesiredState MachineDesiredState
Spec MachineSpec
}
type NodeServerConfig ¶
type NodeService ¶
type NodeService interface {
Start(ctx context.Context) error
Stop(ctx context.Context) error
AuthorityCertificate() *x509.Certificate
TLSCertificate() *tls.Certificate
ListMachines(ctx context.Context) ([]*Machine, error)
FindMachine(ctx context.Context, machineID string) (*Machine, error)
CreateMachine(ctx context.Context, opts NodeCreateMachineOptions) (*Machine, error)
UpdateMachineDesiredState(ctx context.Context, opts NodeUpdateMachineDesiredStateOptions) (*Machine, error)
}
type NodeUpdateMachineDesiredStateOptions ¶
type NodeUpdateMachineDesiredStateOptions struct {
MachineID string
DesiredState MachineDesiredState
}
type RuntimeCreateOptions ¶
type RuntimeCreateOptions struct {
MachineID string
Spec MachineSpec
Volume Volume
NetworkInterface NetworkInterface
}
type RuntimeProvider ¶
type RuntimeProvider interface {
GC(ctx context.Context, getExpectedMachineIDs func() []string) error
Create(ctx context.Context, opts RuntimeCreateOptions) (int, error)
Boot(ctx context.Context, machineID string) error
Terminate(ctx context.Context, machineID string) error
Healthcheck(ctx context.Context, machineID string) error
}
Click to show internal directories.
Click to hide internal directories.