Documentation
¶
Index ¶
- Constants
- type ExecOptions
- type ExecResult
- type Fleet
- type FleetStatus
- type Gateway
- type GuestConfig
- type InitConfig
- type LogEntry
- type Machine
- type MachineConfig
- type MachineDestroyEventPayload
- type MachineEvent
- type MachineEventPayload
- type MachineEventType
- type MachineExitedEventPayload
- type MachinePrepareFailedEventPayload
- type MachineStartEventPayload
- type MachineStartFailedEventPayload
- type MachineStartedEventPayload
- type MachineStatus
- type MachineStopEventPayload
- type MachineVersion
- type Namespace
- type Node
- type Origin
- type Resources
- type RestartPolicy
- type RestartPolicyConfig
- type StopConfig
- type Workload
Constants ¶
View Source
const DefaultStopSignal = "SIGTERM"
View Source
const DefaultStopTimeout = 5 // in seconds
View Source
const MaxStopTimeout = 30 // in seconds
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecOptions ¶
func (*ExecOptions) GetTimeout ¶
func (e *ExecOptions) GetTimeout() time.Duration
type ExecResult ¶
type FleetStatus ¶
type FleetStatus string
const ( FleetStatusActive FleetStatus = "active" FleetStatusDestroyed FleetStatus = "destroyed" )
type GuestConfig ¶
type InitConfig ¶
type Machine ¶
type Machine struct { Id string `json:"id"` Namespace string `json:"namespace"` FleetId string `json:"fleet"` InstanceId string `json:"instance_id"` MachineVersion string `json:"machine_version"` Region string `json:"region"` Config MachineConfig `json:"config"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Events []MachineEvent `json:"events"` Status MachineStatus `json:"state"` }
type MachineConfig ¶
type MachineConfig struct { Image string `json:"image"` Guest GuestConfig `json:"guest"` Workload Workload `json:"workload"` StopConfig *StopConfig `json:"stop_config,omitempty"` AutoDestroy bool `json:"auto_destroy,omitempty"` }
type MachineEvent ¶
type MachineEvent struct { Id ulid.ULID `json:"id"` MachineId string `json:"machine_id"` InstanceId string `json:"instance_id"` Status MachineStatus `json:"status"` Type MachineEventType `json:"type"` Origin Origin `json:"origin"` Payload MachineEventPayload `json:"payload"` Timestamp time.Time `json:"timestamp"` }
type MachineEventPayload ¶
type MachineEventPayload struct { PrepareFailed *MachinePrepareFailedEventPayload `json:"prepare_failed,omitempty"` Stop *MachineStopEventPayload `json:"stop,omitempty"` Start *MachineStartEventPayload `json:"start,omitempty"` StartFailed *MachineStartFailedEventPayload `json:"start_failed,omitempty"` Started *MachineStartedEventPayload `json:"started,omitempty"` Exited *MachineExitedEventPayload `json:"stopped,omitempty"` Destroy *MachineDestroyEventPayload `json:"destroy,omitempty"` }
type MachineEventType ¶
type MachineEventType string
const ( MachineCreated MachineEventType = "machine.created" MachinePrepare MachineEventType = "machine.prepare" MachinePrepared MachineEventType = "machine.prepared" MachinePrepareFailed MachineEventType = "machine.prepare_failed" MachineStart MachineEventType = "machine.start" MachineStartFailed MachineEventType = "machine.start_failed" MachineStarted MachineEventType = "machine.started" MachineStop MachineEventType = "machine.stop" MachineStopFailed MachineEventType = "machine.stop_failed" MachineExited MachineEventType = "machine.exited" MachineDestroy MachineEventType = "machine.destroy" MachineDestroyed MachineEventType = "machine.destroyed" )
type MachinePrepareFailedEventPayload ¶
type MachinePrepareFailedEventPayload struct {
Error string `json:"error"`
}
type MachineStartEventPayload ¶
type MachineStartEventPayload struct {
IsRestart bool `json:"is_restart"`
}
type MachineStartFailedEventPayload ¶
type MachineStartFailedEventPayload struct {
Error string `json:"error"`
}
type MachineStatus ¶
type MachineStatus string
const ( MachineStatusCreated MachineStatus = "created" MachineStatusPreparing MachineStatus = "preparing" MachineStatusStarting MachineStatus = "starting" MachineStatusRunning MachineStatus = "running" MachineStatusStopping MachineStatus = "stopping" MachineStatusStopped MachineStatus = "stopped" MachineStatusDestroying MachineStatus = "destroying" MachineStatusDestroyed MachineStatus = "destroyed" )
type MachineStopEventPayload ¶
type MachineStopEventPayload struct {
Config *StopConfig `json:"config,omitempty"`
}
type MachineVersion ¶
type MachineVersion struct { Id string `json:"id"` MachineId string `json:"machine_id"` Namespace string `json:"namespace"` Config MachineConfig `json:"config"` Resources Resources `json:"resources"` }
type Node ¶
type Node struct { Id string `json:"id"` Address string `json:"address"` AgentPort int `json:"agent_port"` HttpProxyPort int `json:"proxy_port"` Region string `json:"region"` HeartbeatedAt time.Time `json:"heartbeated_at"` }
func (*Node) AgentAddress ¶
func (*Node) HttpProxyAddress ¶
type Resources ¶
type Resources struct { CpusMHz int `json:"cpus_mhz" toml:"cpus_mhz"` // in MHz MemoryMB int `json:"memory_mb" toml:"memory_mb"` // in MB }
type RestartPolicy ¶
type RestartPolicy string
const ( RestartPolicyAlways RestartPolicy = "always" RestartPolicyOnFailure RestartPolicy = "on-failure" RestartPolicyNever RestartPolicy = "never" )
type RestartPolicyConfig ¶
type RestartPolicyConfig struct { Policy RestartPolicy `json:"policy,omitempty"` MaxRetries int `json:"max_retries,omitempty"` }
type StopConfig ¶
type StopConfig struct { Timeout *int `json:"timeout,omitempty"` // in seconds Signal *string `json:"signal,omitempty"` }
func GetDefaultStopConfig ¶
func GetDefaultStopConfig() *StopConfig
type Workload ¶
type Workload struct { Restart RestartPolicyConfig `json:"restart,omitempty"` Env []string `json:"env,omitempty"` Init InitConfig `json:"init,omitempty"` }
Click to show internal directories.
Click to hide internal directories.