Help us shape the future of Go! Take the 2026 Go Developer Survey

policy

package
v0.48.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConftestVersionEnvKey = "DEFAULT_CONFTEST_VERSION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Param  string
	Option string
}

func NewPolicyArg

func NewPolicyArg(parameter string) Arg

type ConfTestExecutorWorkflow

type ConfTestExecutorWorkflow struct {
	SourceResolver         SourceResolver
	VersionCache           cache.ExecutionVersionCache
	DefaultConftestVersion *version.Version
	Exec                   runtime_models.Exec
}

ConfTestExecutorWorkflow runs a versioned conftest binary with the args built from the project context. Project context defines whether conftest runs a local policy set or runs a test on a remote policy set.

func NewConfTestExecutorWorkflow

func NewConfTestExecutorWorkflow(log logging.SimpleLogging, versionRootDir string, conftestDownloder Downloader) *ConfTestExecutorWorkflow

func (*ConfTestExecutorWorkflow) EnsureExecutorVersion

func (c *ConfTestExecutorWorkflow) EnsureExecutorVersion(log logging.SimpleLogging, v *version.Version) (string, error)

func (*ConfTestExecutorWorkflow) Run

func (c *ConfTestExecutorWorkflow) Run(ctx command.ProjectContext, executablePath string, envs map[string]string, workdir string, extraArgs []string) (string, error)

type ConfTestGoGetterVersionDownloader added in v0.30.0

type ConfTestGoGetterVersionDownloader struct{}

func (ConfTestGoGetterVersionDownloader) GetAny added in v0.30.0

func (c ConfTestGoGetterVersionDownloader) GetAny(dst, src string) error

type ConfTestVersionDownloader

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

type ConftestTestCommandArgs

type ConftestTestCommandArgs struct {
	PolicyArgs []Arg
	ExtraArgs  []string
	InputFile  string
	Command    string
	// Env are the environment variables the conftest process will receive.
	// Administrator-configured values are expanded against them, since the
	// previous shell-based command line expanded them too.
	Env map[string]string
}

type Downloader added in v0.30.0

type Downloader interface {
	GetAny(dst, src string) error
}

type LocalSourceResolver

type LocalSourceResolver struct {
}

LocalSourceResolver resolves a local policy set to a local fs path

func (*LocalSourceResolver) Resolve

func (p *LocalSourceResolver) Resolve(policySet valid.PolicySet) (string, error)

type SourceResolver

type SourceResolver interface {
	Resolve(policySet valid.PolicySet) (string, error)
}

SourceResolver resolves the policy set to a local fs path

type SourceResolverProxy

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

SourceResolverProxy proxies to underlying source resolvers dynamically

func (*SourceResolverProxy) Resolve

func (p *SourceResolverProxy) Resolve(policySet valid.PolicySet) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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