metadoc

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Import

type Import struct {
	Path string
	As   string
}

func (Import) String

func (imp Import) String() string

type RegoMeta

type RegoMeta struct {
	PackageName string // Optional package name

	Imports map[Import]struct{} // Imports (without aliases)

	Id                 string
	Title              string
	Description        string
	Severity           string
	Controls           map[string][]string
	Families           []string
	Providers          []string
	RuleRemediationDoc string

	ResourceType string // Resource type

	InputType string // Input type
	// contains filtered or unexported fields
}

Utility to modify metadata of rego files.

You can load this using `RegoMetaFromPath` or `RegoMetaFromString`.

Then, you read and/or modify the public fields of this structure. When you're done, you can turn it into a string again using `String()` and pass it to OPA or write it to disk.

func RegoMetaFromPath

func RegoMetaFromPath(path string) (*RegoMeta, error)

func RegoMetaFromString

func RegoMetaFromString(str string) (*RegoMeta, error)

func (*RegoMeta) HasMetadoc

func (rego *RegoMeta) HasMetadoc() bool

HasMetadoc returns true if the rego file has a metadoc section.

func (*RegoMeta) String

func (rego *RegoMeta) String() string

Jump to

Keyboard shortcuts

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