policy

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WitnessPolicyKey is witness policy key in config store.
	WitnessPolicyKey = "witness-policy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type WitnessPolicy

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

WitnessPolicy evaluates witness policy.

func New

func New(retriever policyRetriever, policyCacheExpiry time.Duration) (*WitnessPolicy, error)

New will create new witness policy evaluator.

func (*WitnessPolicy) Evaluate

func (wp *WitnessPolicy) Evaluate(witnesses []*proof.WitnessProof) (bool, error)

Evaluate evaluates if witness policy has been satisfied for provided witnesses.

func (*WitnessPolicy) Select

func (wp *WitnessPolicy) Select(witnesses []*proof.Witness, exclude ...*proof.Witness) ([]*proof.Witness, error)

Select selects min number of witnesses required based on witness policy.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
selector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL