blob: 19592439e89e1d02db02ebb880a7b06dea37fa30 [file] [log] [blame]
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package effects
import (
// Effect defines something that a policy might enact on an individual *attr.
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)
// EffectResult contains the sideproducts of an executed effect.
type EffectResult interface {
HasActed() bool
JSONResult() string
TextResult() string