source

package
v0.8.33 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DownloaderFuncKey key        = 0
	PolicyKind        PolicyType = "policy"
	DataKind          PolicyType = "data"
	ConfigKind        PolicyType = "config"
	InlineDataKind    PolicyType = "inline-data"
)

Variables

This section is empty.

Functions

func ClearDownloadCache added in v0.8.2

func ClearDownloadCache()

ClearDownloadCache clears the download cache. This is primarily used for testing.

func GoGetterDownload

func GoGetterDownload(ctx context.Context, tmpDir, src string) (string, error)

func SourceIsFile

func SourceIsFile(src string) bool

SourceIsFile returns true if go-getter thinks the src looks like a file path. Ensuring that the src is not a git url is important because go-getter can think that a git url is a file path url.

func SourceIsGit

func SourceIsGit(src string) bool

SourceIsGit returns true if go-getter thinks the src looks like a git url

func SourceIsHttp

func SourceIsHttp(src string) bool

SourceIsHttp returns true if go-getter thinks the src looks like an http url

Types

type PolicySource

type PolicySource interface {
	GetPolicy(ctx context.Context, dest string, showMsg bool) (string, error)
	PolicyUrl() string
	Subdir() string
	Type() PolicyType
}

PolicySource in an interface representing the location a policy source. Must implement the GetPolicy() method.

func InlineData

func InlineData(source []byte) PolicySource

func PolicySourcesFrom

func PolicySourcesFrom(s ecc.Source) []PolicySource

PolicySourcesFrom returns an array of policy sources

type PolicyType

type PolicyType string

type PolicyUrl

type PolicyUrl struct {
	// A string containing a go-getter style source url compatible with conftest pull
	Url  string
	Kind PolicyType
}

func (*PolicyUrl) GetPolicy

func (p *PolicyUrl) GetPolicy(ctx context.Context, workDir string, showMsg bool) (string, error)

GetPolicy clones the repository for a given PolicyUrl

func (*PolicyUrl) PolicyUrl

func (p *PolicyUrl) PolicyUrl() string

func (*PolicyUrl) Subdir

func (p *PolicyUrl) Subdir() string

func (PolicyUrl) Type

func (p PolicyUrl) Type() PolicyType

Jump to

Keyboard shortcuts

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