Documentation
¶
Index ¶
- Variables
- func Download(ctx context.Context, source string, outputDir string, binaryPath string, ...) (string, error)
- func ExtractAnnotations(comments []*ast.Comment) map[string]interface{}
- func GetAnnotations(ctx context.Context, source string, option ...remote.Option) (map[string]string, error)
- func IsOCI(source string) bool
- func OnError(err error, callback func(err error))
- func PolicyCompiler(ctx context.Context, policyPath string) *ast.Compiler
- func SeededUUID(seedData []string) (uuid.UUID, error)
- func SourceDigest(source, localPath string) string
- func SubtractSlice(left []string, right []string) []string
- func Untar(destination string, tarReader io.Reader) error
Constants ¶
This section is empty.
Variables ¶
var RequiredAnnotations = []string{
"title",
"description",
"controls",
}
Functions ¶
func ExtractAnnotations ¶
ExtractAnnotations takes comments from a rego file, and finds the metadata within. Metadata starts with a line `METADATA`, followed by a yaml document specifying the metadata for the specific policy. We use this to build a better picture of what the policy is used for, which controls it verifies, and who the responsible parties are.
func GetAnnotations ¶ added in v0.3.0
func SourceDigest ¶ added in v0.8.0
SourceDigest returns the digest of what the agent runs from source, extracted at localPath. For an OCI source it is the registry digest recorded when the agent downloaded it, or "" for files extracted before digests were recorded. For a local file, such as a plugin binary, it is the file's SHA-256. Otherwise it is "".
func SubtractSlice ¶
Types ¶
This section is empty.