go: go.chromium.org/chromiumos/infra/go/cmd/cycler/effects Index | Files

package effects

import "go.chromium.org/chromiumos/infra/go/cmd/cycler/effects"

Index

Package Files

chill.go delete.go duplicate.go effect.go move.go noop.go util.go

func CheckMutationAllowed Uses

func CheckMutationAllowed(checks []bool)

CheckMutationAllowed will exit if any check in checks is false.

type ChillEffect Uses

type ChillEffect struct {
    Config cycler_pb.ChillEffectConfiguration `json:"ChillEffectConfiguration"`
    // contains filtered or unexported fields
}

ChillEffect runtime and configuration state.

func (ChillEffect) DefaultActor Uses

func (ce ChillEffect) DefaultActor() interface{}

func (*ChillEffect) Enact Uses

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 (*ChillEffect) Initialize Uses

func (ce *ChillEffect) Initialize(config interface{}, actor interface{}, checks ...bool)

Init the chill effect.

type ChillResult Uses

type ChillResult struct {
    // contains filtered or unexported fields
}

ChillResult defines all outputs of a move effect.

func (ChillResult) HasActed Uses

func (cr ChillResult) HasActed() bool

HasActed is true if the effect was applied.

func (ChillResult) JSONResult Uses

func (cr ChillResult) JSONResult() string

JSONResult is the JSON result.

func (ChillResult) TextResult Uses

func (cr ChillResult) TextResult() string

TextResult is the unformatted text result.

type DeleteEffect Uses

type DeleteEffect struct {
    Config cycler_pb.DeleteEffectConfiguration `json:"DeleteEffectConfiguration"`
    // contains filtered or unexported fields
}

DeleteEffect runtime and configuration state.

func (DeleteEffect) DefaultActor Uses

func (de DeleteEffect) DefaultActor() interface{}

func (*DeleteEffect) Enact Uses

func (de *DeleteEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)

Enact does the delete operation on the attr.

func (*DeleteEffect) Initialize Uses

func (de *DeleteEffect) Initialize(config interface{}, actor interface{}, checks ...bool)

Init the DeleteEffect

type DeleteResult Uses

type DeleteResult struct {
    // contains filtered or unexported fields
}

DeleteResult defines all outputs of a delet eeffect.

func (DeleteResult) HasActed Uses

func (dr DeleteResult) HasActed() bool

HasActed is true if the effect was applied.

func (DeleteResult) JSONResult Uses

func (dr DeleteResult) JSONResult() string

JSONResult is the JSON result.

func (DeleteResult) TextResult Uses

func (dr DeleteResult) TextResult() string

TextResult is the unformatted text result.

type DuplicateEffect Uses

type DuplicateEffect struct {
    Config cycler_pb.DuplicateEffectConfiguration `json:"DuplicateEffectConfiguration"`
    // contains filtered or unexported fields
}

DuplicateEffect runtime and configuration state.

func (DuplicateEffect) DefaultActor Uses

func (de DuplicateEffect) DefaultActor() interface{}

func (*DuplicateEffect) Enact Uses

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 (*DuplicateEffect) Initialize Uses

func (de *DuplicateEffect) Initialize(config interface{}, actor interface{}, checks ...bool)

Init the DuplicateEffect, duplicate doesn't mutate so skip checks.

type DuplicateResult Uses

type DuplicateResult struct {
    // contains filtered or unexported fields
}

DuplicateResult defines all outputs of an echo effect.

func (DuplicateResult) HasActed Uses

func (dr DuplicateResult) HasActed() bool

HasActed is true if the effect was applied.

func (DuplicateResult) JSONResult Uses

func (dr DuplicateResult) JSONResult() string

JSONResult is the JSON result.

func (DuplicateResult) TextResult Uses

func (dr DuplicateResult) TextResult() string

TextResult is the unformatted text result.

type Effect Uses

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.

type EffectResult Uses

type EffectResult interface {
    HasActed() bool
    JSONResult() string
    TextResult() string
}

EffectResult contains the sideproducts of an executed effect.

type MoveEffect Uses

type MoveEffect struct {
    Config cycler_pb.MoveEffectConfiguration `json:"MoveEffectConfiguration"`
    // contains filtered or unexported fields
}

MoveEffect runtime and configuration state.

func (MoveEffect) DefaultActor Uses

func (me MoveEffect) DefaultActor() interface{}

func (*MoveEffect) Enact Uses

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 (*MoveEffect) Initialize Uses

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 Uses

type MoveEffectConfig struct {
    DestinationBucket string `json:"DestinationBucket"`
    DestinationPrefix string `json:"DestinationPrefix"`
}

MoveEffectConfig configuration.

type MoveResult Uses

type MoveResult struct {
    // contains filtered or unexported fields
}

MoveResult defines all outputs of a move effect.

func (MoveResult) HasActed Uses

func (mr MoveResult) HasActed() bool

HasActed is true if the effect was applied.

func (MoveResult) JSONResult Uses

func (mr MoveResult) JSONResult() string

JSONResult is the JSON result.

func (MoveResult) TextResult Uses

func (mr MoveResult) TextResult() string

TextResult is the unformatted text result.

type NoopEffect Uses

type NoopEffect struct {
    Config cycler_pb.NoopEffectConfiguration `json:"NoopEffectConfiguration"`
}

NoopEffect runtime and configuration state.

func (NoopEffect) DefaultActor Uses

func (ne NoopEffect) DefaultActor() interface{}

func (*NoopEffect) Enact Uses

func (ne *NoopEffect) Enact(ctx context.Context, client *storage.Client, attr *storage.ObjectAttrs) (EffectResult, error)

Enact nothing.

func (*NoopEffect) Initialize Uses

func (ne *NoopEffect) Initialize(config interface{}, actor interface{}, checks ...bool)

Init nothing.

type NoopResult Uses

type NoopResult struct {
    // contains filtered or unexported fields
}

NoopResult defines all outputs of an echo effect.

func (NoopResult) HasActed Uses

func (nr NoopResult) HasActed() bool

HasActed is true if the effect was applied.

func (NoopResult) JSONResult Uses

func (nr NoopResult) JSONResult() string

JSONResult is the JSON result.

func (NoopResult) TextResult Uses

func (nr NoopResult) TextResult() string

TextResult is the unformatted text result.

Package effects imports 7 packages (graph) and is imported by 1 packages. Updated 2020-10-27. Refresh now. Tools for package owners.