metadoc

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 5 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

	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) String

func (rego *RegoMeta) String() string

Jump to

Keyboard shortcuts

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