policy

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCompiler

func BuildCompiler(files []string) (*ast.Compiler, error)

BuildCompiler compiles all of the given Rego policies and returns the Compiler containing the compilation state

func Detect

func Detect(url string, dst string) (string, error)

Detect determines whether a url is a known source url from which we can download files. If a known source is found, the url is formatted, otherwise an error is returned.

func Download

func Download(ctx context.Context, dst string, urls []string) error

Download downloads the given policies into the given destination

func ReadFiles

func ReadFiles(path string) ([]string, error)

ReadFiles returns all of the policy files (not including tests) at the given path including its subdirectories.

func ReadFilesWithTests

func ReadFilesWithTests(path string) ([]string, error)

ReadFilesWithTests returns all of the policies and test files at the given path including its subdirectories. Test files are Rego files that have a suffix of _test.rego

Types

type OCIDetector

type OCIDetector struct{}

OCIDetector implements Detector to detect OCI registry URLs and turn them into URLs that the OCI getter can understand.

func (*OCIDetector) Detect

func (d *OCIDetector) Detect(src, _ string) (string, bool, error)

type OCIGetter

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

func (*OCIGetter) ClientMode

func (g *OCIGetter) ClientMode(u *url.URL) (getter.ClientMode, error)

func (*OCIGetter) Context

func (g *OCIGetter) Context() context.Context

Context tries to returns the Contex from the getter's client. otherwise context.Background() is returned.

func (*OCIGetter) Get

func (g *OCIGetter) Get(path string, u *url.URL) error

func (*OCIGetter) GetFile

func (g *OCIGetter) GetFile(dst string, u *url.URL) error

func (*OCIGetter) SetClient

func (g *OCIGetter) SetClient(c *getter.Client)

These methods are normally handled by the base getter in go-getter but the base getter is not exported

Jump to

Keyboard shortcuts

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