source

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DownloaderFuncKey key        = 0
	PolicyKind        policyKind = "policy"
	DataKind          policyKind = "data"
	ConfigKind        policyKind = "config"
)

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
}

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

func FetchPolicySources

func FetchPolicySources(s ecc.Source) ([]PolicySource, error)

FetchPolicySources returns an array of policy sources

func InlineData

func InlineData(source []byte) PolicySource

type PolicyUrl

type PolicyUrl struct {
	// A string containing a go-getter style source url compatible with conftest pull
	Url string
	// Either "data", "policy", or "config"
	Kind policyKind
}

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

Jump to

Keyboard shortcuts

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