source

package
v0.6.67 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 20 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 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 added in v0.6.57

func PolicySourcesFrom(s ecc.Source) []PolicySource

PolicySourcesFrom returns an array of policy sources

type PolicyType added in v0.6.53

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)

GetPolicies 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 added in v0.6.53

func (p PolicyUrl) Type() PolicyType

Jump to

Keyboard shortcuts

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