Documentation
¶
Index ¶
- Variables
- func AllSlaves(ctx context.Context) bool
- func Env(ctx context.Context) []string
- func HasResourceSelector(ctx context.Context) bool
- func IsActionForMaster(ctx context.Context) bool
- func IsActionForSlave(ctx context.Context, nodename string) bool
- func IsConfirm(ctx context.Context) bool
- func IsCron(ctx context.Context) bool
- func IsForce(ctx context.Context) bool
- func IsLeader(ctx context.Context) bool
- func IsLockDisabled(ctx context.Context) bool
- func IsQuiet(ctx context.Context) bool
- func IsResourceSelected(ctx context.Context, path naming.Path, rid string) (selected, known bool)
- func IsRollbackDisabled(ctx context.Context) bool
- func LockTimeout(ctx context.Context) time.Duration
- func Master(ctx context.Context) bool
- func MoveTo(ctx context.Context) string
- func RID(ctx context.Context) string
- func Slaves(ctx context.Context) []string
- func Subset(ctx context.Context) string
- func Tag(ctx context.Context) string
- func Target(ctx context.Context) []string
- func To(ctx context.Context) string
- func Verbose(ctx context.Context) int
- func WithAllSlaves(ctx context.Context, v bool) context.Context
- func WithConfirm(ctx context.Context, v bool) context.Context
- func WithCron(ctx context.Context, v bool) context.Context
- func WithEnv(ctx context.Context, s []string) context.Context
- func WithForce(ctx context.Context, v bool) context.Context
- func WithLeader(ctx context.Context, v bool) context.Context
- func WithLockDisabled(ctx context.Context, v bool) context.Context
- func WithLockTimeout(ctx context.Context, d time.Duration) context.Context
- func WithMaster(ctx context.Context, v bool) context.Context
- func WithMoveTo(ctx context.Context, v string) context.Context
- func WithProps(ctx context.Context, props Properties) context.Context
- func WithQuiet(ctx context.Context, v bool) context.Context
- func WithRID(ctx context.Context, s string) context.Context
- func WithRollbackDisabled(ctx context.Context, v bool) context.Context
- func WithSelectedRIDs(ctx context.Context, path naming.Path, rids []string) context.Context
- func WithSlaves(ctx context.Context, s []string) context.Context
- func WithSubset(ctx context.Context, s string) context.Context
- func WithTag(ctx context.Context, s string) context.Context
- func WithTarget(ctx context.Context, s []string) context.Context
- func WithTo(ctx context.Context, s string) context.Context
- func WithVerbose(ctx context.Context, v int) context.Context
- type Properties
Constants ¶
This section is empty.
Variables ¶
var ( Boot = Properties{ Name: "boot", Target: "booted", Progress: "booting", Failure: "boot failed", MustLock: true, Order: ordering.Desc, Freeze: true, TimeoutKeywords: []string{"timeout"}, PG: true, } Delete = Properties{ Name: "delete", Target: "deleted", Progress: "deleting", Failure: "delete failed", Order: ordering.Desc, MustLock: true, } Freeze = Properties{ Name: "freeze", Target: "frozen", Progress: "freezing", Failure: "freeze failed", PG: true, } PRStart = Properties{ Name: "prstart", Failure: "start failed", Progress: "starting", Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } PRStop = Properties{ Name: "prstop", Failure: "stop failed", MustLock: true, Order: ordering.Desc, Progress: "stopping", TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } Set = Properties{ Name: "set", MustLock: true, } SetProvisioned = Properties{ Name: "set provisioned", MustLock: true, } SetUnprovisioned = Properties{ Name: "set unprovisioned", MustLock: true, } Status = Properties{ Name: "status", PG: true, MustLock: true, LockGroup: "status", } Enable = Properties{ Name: "enable", MustLock: true, } Disable = Properties{ Name: "disable", MustLock: true, } Unset = Properties{ Name: "unset", MustLock: true, } ValidateConfig = Properties{ Name: "validate_config", MustLock: true, } Provision = Properties{ Name: "provision", Target: "provisioned", Progress: "provisioning", Failure: "provision failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"provision_timeout", "timeout"}, PG: true, } PushResInfo = Properties{ Name: "push resinfo", PG: true, } Run = Properties{ Name: "run", TimeoutKeywords: []string{"run_timeout", "timeout"}, PG: true, } Shutdown = Properties{ Name: "shutdown", Target: "shutdown", Progress: "shutting", Failure: "shutdown failed", Order: ordering.Desc, TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } PGUpdate = Properties{ Name: "pg_update", MustLock: true, PG: true, } PGReset = Properties{ Name: "pg_reset", MustLock: true, PG: true, } Start = Properties{ Name: "start", Target: "started", Progress: "starting", Failure: "start failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } StartStandby = Properties{ Name: "startstandby", Progress: "starting", Failure: "start failed", MustLock: true, Rollback: true, TimeoutKeywords: []string{"start_timeout", "timeout"}, PG: true, } Stop = Properties{ Name: "stop", Target: "stopped", Progress: "stopping", Failure: "stop failed", MustLock: true, Order: ordering.Desc, Freeze: true, TimeoutKeywords: []string{"stop_timeout", "timeout"}, PG: true, } SyncFull = Properties{ Name: "sync_full", MustLock: true, PG: true, } SyncIngest = Properties{ Name: "sync_ingest", MustLock: true, PG: true, } SyncResync = Properties{ Name: "sync_resync", MustLock: true, PG: true, } SyncSplit = Properties{ Name: "sync_split", MustLock: true, PG: true, } SyncUpdate = Properties{ Name: "sync_update", MustLock: true, PG: true, } Unfreeze = Properties{ Name: "unfreeze", Target: "unfrozen", Progress: "unfreezing", Failure: "unfreeze failed", PG: true, } Unprovision = Properties{ Name: "unprovision", Target: "unprovisioned", Progress: "unprovisioning", Failure: "unprovision failed", MustLock: true, Order: ordering.Desc, TimeoutKeywords: []string{"unprovision_timeout", "timeout"}, PG: true, } )
Functions ¶
func HasResourceSelector ¶
func IsActionForMaster ¶
func IsLockDisabled ¶
func IsResourceSelected ¶
IsResourceSelected tells whether the resource identified by rid, of the object at path, is among the ones recorded by WithSelectedRIDs. The known return value is false when no selection is recorded for this object, i.e. outside an action, during an action on all the resources, or during the status evaluation of another object, so the caller can apply its default policy.
func IsRollbackDisabled ¶
func WithSelectedRIDs ¶
WithSelectedRIDs records the rids of the resources an action with a resource selection works on or reads the state of, for the object at path. Drivers read it with IsResourceSelected, for example to spare a provider api call on a resource the action does not depend on.
The path scopes the rids: an action can evaluate the status of another object with the same context, like the start affinity checks do, and the resources of that object must not be judged by this selection.