Documentation
¶
Index ¶
- func AcquireAllLeases(ctx context.Context, appName string) ([]*fly.Machine, releaseLeaseFunc, error)
- func AcquireLease(ctx context.Context, appName string, machine *fly.Machine) (*fly.Machine, releaseLeaseFunc, error)
- func AcquireLeases(ctx context.Context, appName string, machines []*fly.Machine) ([]*fly.Machine, releaseLeaseFunc, error)
- func CloneConfig(orig *fly.MachineConfig) *fly.MachineConfig
- func ConfirmConfigChanges(ctx context.Context, machine *fly.Machine, targetConfig fly.MachineConfig, ...) (bool, error)
- func LaunchEphemeral(ctx context.Context, appName string, input *EphemeralInput) (*fly.Machine, func(), error)
- func ListActive(ctx context.Context, appName string) ([]*fly.Machine, error)
- func NewMachineSet(flapsClient flapsutil.FlapsClient, io *iostreams.IOStreams, appName string, ...) *machineSet
- func ResolveWaitTimeoutContext(ctx context.Context, timeout time.Duration, allowInfinite bool) (context.Context, context.CancelFunc, time.Duration)
- func Restart(ctx context.Context, appName string, m *fly.Machine, ...) error
- func Update(ctx context.Context, appName string, m *fly.Machine, ...) error
- func VerifyUpdateApplied(ctx context.Context, client flapsutil.FlapsClient, appName string, ...) (*fly.Machine, error)
- func WaitForLaunch(ctx context.Context, appName string, machine *fly.Machine, ...) (string, error)
- func WaitForStartOrStop(ctx context.Context, appName string, machine *fly.Machine, action string, ...) error
- type EphemeralInput
- type ErrNoConfigChangesFound
- type InvalidConfigErr
- type LeasableMachine
- type MachineSet
- type WaitOption
- type WaitOptions
- type WaitTimeoutErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireAllLeases ¶ added in v0.0.434
func AcquireAllLeases(ctx context.Context, appName string) ([]*fly.Machine, releaseLeaseFunc, error)
AcquireAllLeases works to acquire/attach a lease for each active machine.
func AcquireLease ¶
func AcquireLease(ctx context.Context, appName string, machine *fly.Machine) (*fly.Machine, releaseLeaseFunc, error)
AcquireLease works to acquire/attach a lease for the specified machine. WARNING: Make sure you defer the lease release process.
func AcquireLeases ¶
func AcquireLeases(ctx context.Context, appName string, machines []*fly.Machine) ([]*fly.Machine, releaseLeaseFunc, error)
AcquireLeases works to acquire/attach a lease for each machine specified.
func CloneConfig ¶ added in v0.0.434
func CloneConfig(orig *fly.MachineConfig) *fly.MachineConfig
CloneConfig deep-copies a MachineConfig. If CloneConfig is called on a nil config, nil is returned.
func ConfirmConfigChanges ¶ added in v0.0.434
func LaunchEphemeral ¶ added in v0.1.73
func NewMachineSet ¶ added in v0.0.452
func ResolveWaitTimeoutContext ¶ added in v0.5.19
func ResolveWaitTimeoutContext(ctx context.Context, timeout time.Duration, allowInfinite bool) (context.Context, context.CancelFunc, time.Duration)
ResolveWaitTimeoutContext returns a context that will timeout, with the possibility of an untimed context on time=0 if the flag allowInfinite is set to true.
func VerifyUpdateApplied ¶ added in v0.5.19
func VerifyUpdateApplied(ctx context.Context, client flapsutil.FlapsClient, appName string, previous, target *fly.Machine, waitErr error) (*fly.Machine, error)
VerifyUpdateApplied checks the current version after a successful wait or when the pinned version disappeared or entered a terminal state. The caller supplies the same deadline used for the state wait.
Types ¶
type EphemeralInput ¶ added in v0.1.73
type EphemeralInput struct {
LaunchInput fly.LaunchMachineInput
What string
}
type ErrNoConfigChangesFound ¶ added in v0.0.434
type ErrNoConfigChangesFound struct{}
func (*ErrNoConfigChangesFound) Error ¶ added in v0.0.434
func (e *ErrNoConfigChangesFound) Error() string
type InvalidConfigErr ¶ added in v0.1.79
type InvalidConfigErr struct {
Reason invalidConfigReason
// contains filtered or unexported fields
}
func (InvalidConfigErr) Description ¶ added in v0.1.79
func (e InvalidConfigErr) Description() string
func (InvalidConfigErr) DocURL ¶ added in v0.1.79
func (e InvalidConfigErr) DocURL() string
func (InvalidConfigErr) Error ¶ added in v0.1.79
func (e InvalidConfigErr) Error() string
func (InvalidConfigErr) Suggestion ¶ added in v0.1.79
func (e InvalidConfigErr) Suggestion() string
type LeasableMachine ¶ added in v0.0.452
type LeasableMachine interface {
Machine() *fly.Machine
HasLease() bool
AcquireLease(context.Context, time.Duration) error
RefreshLease(context.Context, time.Duration) error
ReleaseLease(context.Context) error
StartBackgroundLeaseRefresh(context.Context, time.Duration, time.Duration)
Update(context.Context, fly.LaunchMachineInput) error
Start(context.Context) error
Stop(context.Context, string) error
Destroy(context.Context, bool) error
Cordon(context.Context) error
WaitForState(context.Context, string, time.Duration, ...WaitOption) error
WaitForSmokeChecksToPass(context.Context) error
WaitForHealthchecksToPass(context.Context, time.Duration) error
WaitForEventType(context.Context, string, time.Duration, bool) (*fly.MachineEvent, error)
WaitForEventTypeAfterType(context.Context, string, string, time.Duration, bool) (*fly.MachineEvent, error)
FormattedMachineId() string
GetMinIntervalAndMinGracePeriod() (time.Duration, time.Duration)
SetMetadata(ctx context.Context, k, v string) error
GetMetadata(ctx context.Context) (map[string]string, error)
}
func NewLeasableMachine ¶ added in v0.0.452
func NewLeasableMachine(flapsClient flapsutil.FlapsClient, io *iostreams.IOStreams, appName string, machine *fly.Machine, showLogs bool) LeasableMachine
NewLeasableMachine creates a wrapper for the given machine. A lease must be held before calling this function.
type MachineSet ¶ added in v0.0.452
type MachineSet interface {
AcquireLeases(context.Context, time.Duration) error
ReleaseLeases(context.Context) error
RemoveMachines(ctx context.Context, machines []LeasableMachine) error
StartBackgroundLeaseRefresh(context.Context, time.Duration, time.Duration)
IsEmpty() bool
GetMachines() []LeasableMachine
WaitForMachineSetState(context.Context, string, time.Duration, bool, bool) ([]string, error)
}
type WaitOption ¶ added in v0.3.202
type WaitOption func(*WaitOptions)
func WithAllowInfinite ¶ added in v0.3.202
func WithAllowInfinite(allow bool) WaitOption
func WithJustCreated ¶ added in v0.3.202
func WithJustCreated() WaitOption
func WithVersion ¶ added in v0.5.19
func WithVersion(version string) WaitOption
type WaitOptions ¶ added in v0.3.202
type WaitOptions struct {
// contains filtered or unexported fields
}
type WaitTimeoutErr ¶ added in v0.1.82
type WaitTimeoutErr struct {
// contains filtered or unexported fields
}
func (WaitTimeoutErr) Description ¶ added in v0.1.82
func (e WaitTimeoutErr) Description() string
func (WaitTimeoutErr) DesiredState ¶ added in v0.1.131
func (e WaitTimeoutErr) DesiredState() string
func (WaitTimeoutErr) Error ¶ added in v0.1.82
func (e WaitTimeoutErr) Error() string