policy

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloneFn added in v0.0.2

type CloneFn func(s storage.Storer, worktree billy.Filesystem, o *git.CloneOptions) (*git.Repository, error)

type GitClient added in v0.0.2

type GitClient interface {
	Clone(s storage.Storer, worktree billy.Filesystem, o *git.CloneOptions) (*git.Repository, error)
}

type GitPolicyFile added in v0.0.2

type GitPolicyFile struct {
	Hash string
	*PolicyFile
}

type GitPolicySource added in v0.0.2

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

func (GitPolicySource) GetPolicyFiles added in v0.0.2

func (src GitPolicySource) GetPolicyFiles() ([]*PolicyFile, error)

type GitTree added in v0.0.2

type GitTree interface {
	TreeEntryFile(e *object.TreeEntry) (*object.File, error)
}

type GitTreeWalker added in v0.0.2

type GitTreeWalker interface {
	Next() (name string, entry object.TreeEntry, err error)
	Close()
}

type LocalPolicySource added in v0.0.2

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

func (LocalPolicySource) GetPolicyFiles added in v0.0.2

func (src LocalPolicySource) GetPolicyFiles() ([]*PolicyFile, error)

type Policy

type Policy struct {
	Name             string
	FullName         string
	Description      string
	Group            string
	Valid            bool
	Violations       []string
	ProcessingErrors []error
}

type PolicyAgent

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

func NewPolicyAgent

func NewPolicyAgent(ctx context.Context, files []*PolicyFile) *PolicyAgent

func (*PolicyAgent) EvaluatePolicies

func (p *PolicyAgent) EvaluatePolicies(input interface{}) (*PolicyEvaluationResult, error)

type PolicyEvaluationResult

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

func (*PolicyEvaluationResult) AppendErroredPolicy

func (r *PolicyEvaluationResult) AppendErroredPolicy(policy *Policy)

func (*PolicyEvaluationResult) AppendSuccessfulPolicy

func (r *PolicyEvaluationResult) AppendSuccessfulPolicy(policy *Policy)

func (*PolicyEvaluationResult) Errored

func (r *PolicyEvaluationResult) Errored() []*Policy

func (*PolicyEvaluationResult) ErroredCount

func (r *PolicyEvaluationResult) ErroredCount() int

func (*PolicyEvaluationResult) Groups

func (r *PolicyEvaluationResult) Groups() []string

func (*PolicyEvaluationResult) Policies

func (r *PolicyEvaluationResult) Policies(group string) []*Policy

func (*PolicyEvaluationResult) ValidCount

func (r *PolicyEvaluationResult) ValidCount() int

func (*PolicyEvaluationResult) ViolatedCount

func (r *PolicyEvaluationResult) ViolatedCount() int

type PolicyFile added in v0.0.2

type PolicyFile struct {
	Name     string
	FullName string
	Content  string
}

type PolicySource added in v0.0.2

type PolicySource interface {
	GetPolicyFiles() ([]*PolicyFile, error)
}

func NewGitPolicySource added in v0.0.2

func NewGitPolicySource(repoURL string, repoBrach string, policyDir string) PolicySource

func NewLocalPolicySource added in v0.0.2

func NewLocalPolicySource(rootDirectory string) PolicySource

type ReadFn added in v0.0.2

type ReadFn func(name string) ([]byte, error)

type WalkFn added in v0.0.2

type WalkFn func(root string, fn filepath.WalkFunc) error

Jump to

Keyboard shortcuts

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