import "go.chromium.org/chromiumos/infra/go/cmd/cycler/effects"
chill.go delete.go duplicate.go effect.go move.go noop.go util.go
CheckMutationAllowed will exit if any check in checks is false.
type ChillEffect struct { Config cycler_pb.ChillEffectConfiguration `json:"ChillEffectConfiguration"` // contains filtered or unexported fields }
ChillEffect runtime and configuration state.
func (ce ChillEffect) DefaultActor() interface{}
func (ce *ChillEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)
Enact does the move operation on the attr, _this deletes the old object_!
func (ce *ChillEffect) Initialize(config interface{}, actor interface{}, checks ...bool)
Init the chill effect.
type ChillResult struct {
// contains filtered or unexported fields
}
ChillResult defines all outputs of a move effect.
func (cr ChillResult) HasActed() bool
HasActed is true if the effect was applied.
func (cr ChillResult) JSONResult() string
JSONResult is the JSON result.
func (cr ChillResult) TextResult() string
TextResult is the unformatted text result.
type DeleteEffect struct { Config cycler_pb.DeleteEffectConfiguration `json:"DeleteEffectConfiguration"` // contains filtered or unexported fields }
DeleteEffect runtime and configuration state.
func (de DeleteEffect) DefaultActor() interface{}
func (de *DeleteEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)
Enact does the delete operation on the attr.
func (de *DeleteEffect) Initialize(config interface{}, actor interface{}, checks ...bool)
Init the DeleteEffect
type DeleteResult struct {
// contains filtered or unexported fields
}
DeleteResult defines all outputs of a delet eeffect.
func (dr DeleteResult) HasActed() bool
HasActed is true if the effect was applied.
func (dr DeleteResult) JSONResult() string
JSONResult is the JSON result.
func (dr DeleteResult) TextResult() string
TextResult is the unformatted text result.
type DuplicateEffect struct { Config cycler_pb.DuplicateEffectConfiguration `json:"DuplicateEffectConfiguration"` // contains filtered or unexported fields }
DuplicateEffect runtime and configuration state.
func (de DuplicateEffect) DefaultActor() interface{}
func (de *DuplicateEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)
Enact does the duplicate operation on the attr, does not mutate existing object.
func (de *DuplicateEffect) Initialize(config interface{}, actor interface{}, checks ...bool)
Init the DuplicateEffect, duplicate doesn't mutate so skip checks.
type DuplicateResult struct {
// contains filtered or unexported fields
}
DuplicateResult defines all outputs of an echo effect.
func (dr DuplicateResult) HasActed() bool
HasActed is true if the effect was applied.
func (dr DuplicateResult) JSONResult() string
JSONResult is the JSON result.
func (dr DuplicateResult) TextResult() string
TextResult is the unformatted text result.
type Effect interface { // interface{} assumed to be corresponding config struct, checks all must be // true to Initialize, and this is used with the mutation allowed parameter at the moment. DefaultActor() interface{} Initialize(config interface{}, actor interface{}, checks ...bool) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error) }
Effect defines something that a policy might enact on an individual *attr.
EffectResult contains the sideproducts of an executed effect.
type MoveEffect struct { Config cycler_pb.MoveEffectConfiguration `json:"MoveEffectConfiguration"` // contains filtered or unexported fields }
MoveEffect runtime and configuration state.
func (me MoveEffect) DefaultActor() interface{}
func (me *MoveEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)
Enact does the move operation on the attr, _this deletes the old object_!
func (me *MoveEffect) Initialize(config interface{}, actor interface{}, checks ...bool)
Init the move effect with a config and an actor (mock or real function).
type MoveEffectConfig struct { DestinationBucket string `json:"DestinationBucket"` DestinationPrefix string `json:"DestinationPrefix"` }
MoveEffectConfig configuration.
type MoveResult struct {
// contains filtered or unexported fields
}
MoveResult defines all outputs of a move effect.
func (mr MoveResult) HasActed() bool
HasActed is true if the effect was applied.
func (mr MoveResult) JSONResult() string
JSONResult is the JSON result.
func (mr MoveResult) TextResult() string
TextResult is the unformatted text result.
type NoopEffect struct { Config cycler_pb.NoopEffectConfiguration `json:"NoopEffectConfiguration"` }
NoopEffect runtime and configuration state.
func (ne NoopEffect) DefaultActor() interface{}
func (ne *NoopEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)
Enact nothing.
func (ne *NoopEffect) Initialize(config interface{}, actor interface{}, checks ...bool)
Init nothing.
type NoopResult struct {
// contains filtered or unexported fields
}
NoopResult defines all outputs of an echo effect.
func (nr NoopResult) HasActed() bool
HasActed is true if the effect was applied.
func (nr NoopResult) JSONResult() string
JSONResult is the JSON result.
func (nr NoopResult) TextResult() string
TextResult is the unformatted text result.
Package effects imports 7 packages (graph) and is imported by 1 packages. Updated 2021-01-21. Refresh now. Tools for package owners.