Documentation
¶
Index ¶
- func InstanceEventSubject(m, i string) string
- func IsAlreadyExists(err error) bool
- func IsFailedPrecondition(err error) bool
- func IsInternal(err error) bool
- func IsInvalidArgument(err error) bool
- func IsNotFound(err error) bool
- func IsNotImplemented(err error) bool
- func IsResourcesExhausted(err error) bool
- func IsUnknown(err error) bool
- func NewAlreadyExists(msg string) error
- func NewDeadlineExceeded(msg string) error
- func NewFailedPrecondition(msg string) error
- func NewInvalidArgument(msg string) error
- func NewNotFound(msg string) error
- func NewNotImplemented(msg string) error
- func NewResourcesExhausted(msg string) error
- func NewUnknown(msg string) error
- func OverrideHumaErrorBuilder()
- type Agent
- type Allocation
- type AllocationStatus
- type Code
- type CreateInstancePayload
- type ErrorDetail
- type ExecResult
- type Fleet
- type Gateway
- type GuestConfig
- type InitConfig
- type Instance
- type InstanceConfig
- type InstanceCreatedEventPayload
- type InstanceDestroyEventPayload
- type InstanceDestroyedEventPayload
- type InstanceEvent
- type InstanceEventPayload
- type InstanceEventType
- type InstanceExecOptions
- type InstanceExitedEventPayload
- type InstanceGuestConfig
- type InstancePreparationFailedEventPayload
- type InstancePrepareEventPayload
- type InstancePreparedEventPayload
- type InstanceStartEventPayload
- type InstanceStartFailedEventPayload
- type InstanceStartedEventPayload
- type InstanceState
- type InstanceStatus
- type InstanceStopEventPayload
- type InstanceStopFailedEventPayload
- type LogEntry
- type Machine
- type MachineConfig
- type MachineStatus
- type MachineVersion
- type Namespace
- type Node
- type Origin
- type RavelError
- type RegistryAuthConfig
- type Resources
- type RestartPolicy
- type RestartPolicyConfig
- type Service
- type StopConfig
- type Workload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstanceEventSubject ¶ added in v0.0.2
func IsAlreadyExists ¶
func IsFailedPrecondition ¶
func IsInternal ¶
func IsInvalidArgument ¶
func IsNotFound ¶
func IsNotImplemented ¶
func IsResourcesExhausted ¶
func NewAlreadyExists ¶
func NewDeadlineExceeded ¶
func NewFailedPrecondition ¶
func NewInvalidArgument ¶
func NewNotFound ¶
func NewNotImplemented ¶
func NewResourcesExhausted ¶
func NewUnknown ¶
func OverrideHumaErrorBuilder ¶
func OverrideHumaErrorBuilder()
Types ¶
type Agent ¶
type Agent interface { CreateInstance(ctx context.Context, options CreateInstancePayload) (*Instance, error) ListInstances(ctx context.Context) ([]Instance, error) GetInstance(ctx context.Context, id string) (*Instance, error) DestroyInstance(ctx context.Context, id string, force bool) error StartInstance(ctx context.Context, id string) error StopInstance(ctx context.Context, id string, opt *StopConfig) error InstanceExec(ctx context.Context, id string, opt InstanceExecOptions) (*ExecResult, error) SubscribeToInstanceLogs(ctx context.Context, id string) (<-chan []*LogEntry, error) GetInstanceLogs(ctx context.Context, id string) ([]*LogEntry, error) }
type Allocation ¶
type AllocationStatus ¶
type AllocationStatus string
const ( AllocationStatusDangling AllocationStatus = "dangling" AllocationStatusSuspended AllocationStatus = "suspended" AllocationStatusConfirmed AllocationStatus = "confirmed" )
type CreateInstancePayload ¶
type ErrorDetail ¶
type ErrorDetail = huma.ErrorDetail
type ExecResult ¶
type GuestConfig ¶
type InitConfig ¶
type Instance ¶
type Instance struct { Id string `json:"id"` Namespace string `json:"namespace"` NodeId string `json:"node_id"` MachineId string `json:"machine_id"` FleetId string `json:"fleet_id"` Config InstanceConfig `json:"config"` MachineVersion string `json:"machine_version"` LocalIPV4 string `json:"local_ipv4"` ReservationId string `json:"reservation_id"` State InstanceState `json:"state"` CreatedAt time.Time `json:"created_at"` }
type InstanceConfig ¶
type InstanceConfig struct { Guest InstanceGuestConfig Workload Workload StopConfig StopConfig }
type InstanceCreatedEventPayload ¶
type InstanceCreatedEventPayload struct { }
type InstanceDestroyedEventPayload ¶
type InstanceDestroyedEventPayload struct { }
type InstanceEvent ¶
type InstanceEvent struct { Id ulid.ULID `json:"id"` Type InstanceEventType `json:"type"` Origin Origin `json:"origin"` Payload InstanceEventPayload `json:"payload"` MachineId string `json:"machine_id"` InstanceId string `json:"instance_id"` Status InstanceStatus `json:"status"` Timestamp time.Time `json:"timestamp"` }
type InstanceEventPayload ¶
type InstanceEventPayload struct { Created *InstanceCreatedEventPayload `json:"created,omitempty"` Prepare *InstancePrepareEventPayload `json:"prepare,omitempty"` Prepared *InstancePreparedEventPayload `json:"prepared,omitempty"` PreparationFailed *InstancePreparationFailedEventPayload `json:"preparation_failed,omitempty"` Exited *InstanceExitedEventPayload `json:"exited,omitempty"` Start *InstanceStartEventPayload `json:"start,omitempty"` StartFailed *InstanceStartFailedEventPayload `json:"start_failed,omitempty"` Started *InstanceStartedEventPayload `json:"started,omitempty"` Stop *InstanceStopEventPayload `json:"stop,omitempty"` StopFailed *InstanceStopFailedEventPayload `json:"stop_failed,omitempty"` Destroy *InstanceDestroyEventPayload `json:"destroy,omitempty"` Destroyed *InstanceDestroyedEventPayload `json:"destroyed,omitempty"` }
type InstanceEventType ¶
type InstanceEventType string
const ( InstanceCreated InstanceEventType = "instance.created" InstancePrepare InstanceEventType = "instance.prepare" InstancePrepared InstanceEventType = "instance.prepared" InstancePreparationFailed InstanceEventType = "instance.preparation_failed" InstanceStart InstanceEventType = "instance.start" InstanceStartFailed InstanceEventType = "instance.start_failed" InstanceStarted InstanceEventType = "instance.started" InstanceStop InstanceEventType = "instance.stop" InstanceExited InstanceEventType = "instance.exited" InstanceDestroy InstanceEventType = "instance.destroy" InstanceDestroyed InstanceEventType = "instance.destroyed" )
type InstanceExecOptions ¶
type InstanceExecOptions struct { Timeout *time.Duration `json:"timeout,omitempty"` Cmd []string `json:"cmd"` }
func (*InstanceExecOptions) GetTimeout ¶
func (e *InstanceExecOptions) GetTimeout() time.Duration
type InstanceGuestConfig ¶
type InstancePreparationFailedEventPayload ¶
type InstancePreparationFailedEventPayload struct {
Error string
}
type InstancePrepareEventPayload ¶
type InstancePrepareEventPayload struct {
Retries int `json:"retries"`
}
type InstancePreparedEventPayload ¶
type InstancePreparedEventPayload struct{}
type InstanceStartEventPayload ¶
type InstanceStartEventPayload struct {
IsRestart bool `json:"is_restart"`
}
type InstanceStartFailedEventPayload ¶
type InstanceStartFailedEventPayload struct {
Error string `json:"error"`
}
type InstanceStartedEventPayload ¶
type InstanceStartedEventPayload struct { }
type InstanceState ¶
type InstanceState struct { DesiredStatus InstanceStatus `json:"desired_status"` Status InstanceStatus `json:"status"` Restarts int `json:"restarts"` }
type InstanceStatus ¶
type InstanceStatus = MachineStatus
type InstanceStopEventPayload ¶
type InstanceStopEventPayload struct {
Signal string `json:"signal"`
}
type InstanceStopFailedEventPayload ¶
type InstanceStopFailedEventPayload struct {
Error string `json:"error"`
}
type Machine ¶
type Machine struct { Id string `json:"id"` Namespace string `json:"namespace"` FleetId string `json:"fleet_id"` InstanceId string `json:"instance_id"` MachineVersion ulid.ULID `json:"machine_version"` Node string `json:"node"` Region string `json:"region"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Destroyed bool `json:"destroyed"` }
type MachineConfig ¶
type MachineConfig struct { Guest GuestConfig `json:"guest"` Workload Workload `json:"workload"` StopConfig StopConfig `json:"stop_config,omitempty"` AutoDestroy bool `json:"auto_destroy,omitempty"` }
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 MachineVersion ¶
type MachineVersion struct { Id ulid.ULID `json:"id"` MachineId string `json:"machine_id"` Config MachineConfig `json:"config"` }
type RavelError ¶
type RavelError struct { RavelCode Code `json:"code"` Status int `json:"status"` Title string `json:"title"` Detail string `json:"detail"` Errors []*ErrorDetail `json:"errors,omitempty"` // contains filtered or unexported fields }
func FromHTTPResponse ¶
func FromHTTPResponse(resp *http.Response) *RavelError
func (*RavelError) Code ¶
func (r *RavelError) Code() Code
func (*RavelError) Error ¶
func (r *RavelError) Error() string
func (*RavelError) GetStatus ¶
func (r *RavelError) GetStatus() int
type RegistryAuthConfig ¶
type Resources ¶
type RestartPolicy ¶
type RestartPolicy string
const ( RestartPolicyAlways RestartPolicy = "always" RestartPolicyOnFailure RestartPolicy = "on-failure" RestartPolicyNever RestartPolicy = "never" )
type RestartPolicyConfig ¶
type RestartPolicyConfig struct { MaxRetries int `json:"max_retries,omitempty"` Policy RestartPolicy `json:"policy,omitempty"` }
type Service ¶
type Service struct { Id string `json:"id"` InstanceId string `json:"instance_id"` Name string `json:"name"` FleetId string `json:"fleet_id"` LocalIPV4Address string `json:"local_ipv4_address"` LocalPort int `json:"local_port"` HostAddress string `json:"host_address"` HostPort int `json:"host_port"` }
type StopConfig ¶
type StopConfig struct { Timeout *int `json:"timeout,omitempty"` Signal *string `json:"signal,omitempty"` }
func (*StopConfig) GetSignal ¶
func (s *StopConfig) GetSignal() string
func (*StopConfig) GetTimeout ¶
func (s *StopConfig) GetTimeout() time.Duration
type Workload ¶
type Workload struct { Image string `json:"image"` RestartPolicy RestartPolicyConfig `json:"restart_policy,omitempty"` Env []string `json:"env,omitempty"` Init InitConfig `json:"init,omitempty"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.