Documentation
¶
Index ¶
Constants ¶
const ( // QueryFileName The default query file name QueryFileName = "query.rego" // MetadataFileName The default metadata file name MetadataFileName = "metadata.json" // LibraryFileName The default library file name LibraryFileName = "library.rego" // LibrariesDefaultBasePath the path to rego libraries LibrariesDefaultBasePath = "./assets/libraries/" )
Variables ¶
This section is empty.
Functions ¶
func GetPathToLibrary ¶ added in v1.1.2
GetPathToLibrary returns the libraries path for a given platform
func ListSupportedPlatforms ¶ added in v1.2.0
func ListSupportedPlatforms() []string
ListSupportedPlatforms returns a list of supported platforms
func ReadMetadata ¶ added in v1.1.2
ReadMetadata read query's metadata file inside the query directory
Types ¶
type FilesystemSource ¶
FilesystemSource this type defines a struct with a path to a filesystem source of queries Source is the path to the queries Types are the types given by the flag --type for query selection mechanism
func NewFilesystemSource ¶ added in v1.1.3
func NewFilesystemSource(source string, types []string) *FilesystemSource
NewFilesystemSource initializes a NewFilesystemSource with source to queries and types of queries to load
func (*FilesystemSource) CheckType ¶ added in v1.1.3
func (s *FilesystemSource) CheckType(queryPlatform interface{}) bool
CheckType checks if the queries have the type passed as an argument in '--type' flag to be loaded
func (*FilesystemSource) GetGenericQuery ¶ added in v1.1.2
func (s *FilesystemSource) GetGenericQuery(platform string) (string, error)
GetGenericQuery returns the library.rego for the platform passed in the argument
func (*FilesystemSource) GetQueries ¶
func (s *FilesystemSource) GetQueries(excludeQueries []string) ([]model.QueryMetadata, error)
GetQueries walks a given filesource path returns all queries found in an array of QueryMetadata struct