Package loader contains utilities for loading files into OPA.
AsBundle loads a path as a bundle. If it is a single file it will be treated as a normal tarball bundle. If a directory is supplied it will be loaded as an unzipped bundle tree.
CleanPath returns the normalized version of a path that can be used as an identifier.
Paths returns a sorted list of files contained at path. If recurse is true and path is a directory, then Paths will walk the directory structure recursively and list files at each level.
SplitPrefix returns a tuple specifying the document prefix and the file path.
Errors is a wrapper for multiple loader errors.
Filter defines the interface for filtering files during loading. If the filter returns true, the file should be excluded from the result.
GlobExcludeName excludes files and directories whose names do not match the shell style pattern at minDepth or greater.
RegoFile represents the result of loading a single Rego source file.
Rego returns a RegoFile object loaded from the given path.
Result represents the result of successfully loading zero or more files.
All returns a Result object loaded (recursively) from the specified paths.
AllRegos returns a Result object loaded (recursively) with all Rego source files from the specified paths.
Filtered returns a Result object loaded (recursively) from the specified paths while applying the given filters. If any filter returns true, the file/directory is excluded.
Compiler returns a Compiler object with the compiled modules from this loader result.
ParsedModules returns the parsed modules stored on the result.
Store returns a Store object with the documents from this loader result.