policies

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Providers []PolicyBlock `yaml:"providers"`
	Resources []PolicyBlock `yaml:"resources"`
}

func Parse

func Parse(path string) (Policy, error)

type PolicyBlock

type PolicyBlock struct {
	Type   string                 `yaml:"type"`
	Params map[string]interface{} `yaml:"params"`
}

type PolicyExecutionFlags

type PolicyExecutionFlags struct {
	Strict bool
}

type PolicyOutcome

type PolicyOutcome uint64
const (
	OUTCOME_SUCCESS PolicyOutcome = iota
	OUTCOME_FAIL
	OUTCOME_REMEDIATE
)

type PolicyResult

type PolicyResult struct {
	Outcome PolicyOutcome
	Reason  string
}

type ProviderPolicyExecutor

type ProviderPolicyExecutor interface {
	Execute(payload ProviderPolicyPayload) (PolicyResult, error)
}

type ProviderPolicyPayload

type ProviderPolicyPayload struct {
	Policy           PolicyBlock
	WorkingDir       string
	Flags            PolicyExecutionFlags
	CurrentProviders map[string]providers.Version
}

type ResourcePolicyExecutor

type ResourcePolicyExecutor interface {
	Execute(payload ResourcePolicyPayload) (PolicyResult, error)
}

type ResourcePolicyPayload

type ResourcePolicyPayload struct {
	Hcl        *hclwrite.File
	Policy     PolicyBlock
	WorkingDir string
	FileName   string
	FilePath   string
	Flags      PolicyExecutionFlags
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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