Documentation ¶
Index ¶
- Variables
- type GuestConfig
- type InitConfig
- type MachineAPI
- func (a *MachineAPI) CreateMachine(req MachineCreateOrUpdateRequest, app string, res *MachineResponse) error
- func (a *MachineAPI) CreateVolume(ctx context.Context, name, app, region string, size int) (*api.Volume, error)
- func (a *MachineAPI) DeleteMachine(app string, id string, maxRetries int) error
- func (a *MachineAPI) DeleteVolume(ctx context.Context, id, app string) error
- func (a *MachineAPI) GetVolume(ctx context.Context, id, app string) (*api.Volume, error)
- func (a *MachineAPI) LockMachine(app string, id string, timeout int) (*MachineLease, error)
- func (a *MachineAPI) ReadMachine(app string, id string, res *MachineResponse) (*hreq.Response, error)
- func (a *MachineAPI) ReleaseMachine(lease MachineLease, app string, id string) error
- func (a *MachineAPI) UpdateMachine(req MachineCreateOrUpdateRequest, app string, id string, res *MachineResponse) error
- func (a *MachineAPI) WaitForMachine(app string, id string, instanceID string) error
- type MachineConfig
- type MachineCreateOrUpdateRequest
- type MachineLease
- type MachineMount
- type MachineResponse
- type Port
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var NonceHeader = "fly-machine-lease-nonce"
Functions ¶
This section is empty.
Types ¶
type GuestConfig ¶
type InitConfig ¶
type MachineAPI ¶
func NewMachineAPI ¶
func NewMachineAPI(endpoint string, token string) *MachineAPI
func (*MachineAPI) CreateMachine ¶
func (a *MachineAPI) CreateMachine(req MachineCreateOrUpdateRequest, app string, res *MachineResponse) error
CreateMachine takes a MachineCreateOrUpdateRequest and creates the requested machine in the given app and then writes the response into the `res` param
func (*MachineAPI) CreateVolume ¶
func (*MachineAPI) DeleteMachine ¶
func (a *MachineAPI) DeleteMachine(app string, id string, maxRetries int) error
func (*MachineAPI) DeleteVolume ¶
func (a *MachineAPI) DeleteVolume(ctx context.Context, id, app string) error
func (*MachineAPI) LockMachine ¶
func (a *MachineAPI) LockMachine(app string, id string, timeout int) (*MachineLease, error)
func (*MachineAPI) ReadMachine ¶
func (a *MachineAPI) ReadMachine(app string, id string, res *MachineResponse) (*hreq.Response, error)
func (*MachineAPI) ReleaseMachine ¶
func (a *MachineAPI) ReleaseMachine(lease MachineLease, app string, id string) error
func (*MachineAPI) UpdateMachine ¶
func (a *MachineAPI) UpdateMachine(req MachineCreateOrUpdateRequest, app string, id string, res *MachineResponse) error
func (*MachineAPI) WaitForMachine ¶
func (a *MachineAPI) WaitForMachine(app string, id string, instanceID string) error
type MachineConfig ¶
type MachineConfig struct { Image string `json:"image"` Env map[string]string `json:"env"` Init InitConfig `json:"init,omitempty"` Mounts []MachineMount `json:"mounts,omitempty"` Services []Service `json:"services"` Guest GuestConfig `json:"guest,omitempty"` AutoDestroy bool `json:"auto_destroy"` }
type MachineCreateOrUpdateRequest ¶
type MachineCreateOrUpdateRequest struct { Name string `json:"name"` Region string `json:"region"` Config MachineConfig `json:"config"` }
type MachineLease ¶
type MachineMount ¶
type MachineResponse ¶
type MachineResponse struct { ID string `json:"id"` Name string `json:"name"` State string `json:"state"` Region string `json:"region"` InstanceID string `json:"instance_id"` PrivateIP string `json:"private_ip"` Config struct { Env map[string]string `json:"env"` Init struct { Exec []string `json:"exec"` Entrypoint []string `json:"entrypoint"` Cmd []string `json:"cmd"` } `json:"init"` Image string `json:"image"` Metadata interface{} `json:"metadata"` Restart struct { Policy string `json:"policy"` } `json:"restart"` Services []Service `json:"services"` Mounts []MachineMount `json:"mounts"` Guest struct { CPUKind string `json:"cpu_kind"` Cpus int `json:"cpus"` MemoryMb int `json:"memory_mb"` } `json:"guest"` AutoDestroy bool `json:"auto_destroy"` } `json:"config"` ImageRef struct { Registry string `json:"registry"` Repository string `json:"repository"` Tag string `json:"tag"` Digest string `json:"digest"` Labels struct { } `json:"labels"` } `json:"image_ref"` CreatedAt time.Time `json:"created_at"` }
Click to show internal directories.
Click to hide internal directories.