util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirectory

func CreateDirectory(workingDirectory string, name string, strict bool) (string, error)

func CreateFile

func CreateFile(workingDirectory string, name string) (string, error)

func ParseHCL2

func ParseHCL2(p []byte, v interface{}) error

func ParseYAML

func ParseYAML(p []byte, v interface{}) error

ParseYAML unmarshals YAML files and return parsed file content.

func StartProgress

func StartProgress(progressName string, progress ProgressFunc) error

func TemplateFile

func TemplateFile(workingDirectory string, fileName string, template string, templating Templating) error

func Term

func Term() (*ast.Term, error)

Types

type EnumFlag

type EnumFlag struct {
	// contains filtered or unexported fields
}

func NewEnumFlag

func NewEnumFlag(defaultValue string, vs []string) EnumFlag

func (*EnumFlag) IsSet

func (f *EnumFlag) IsSet() bool

IsSet will return true if the EnumFlag has been set.

func (*EnumFlag) Set

func (f *EnumFlag) Set(s string) error

Set sets the enum value. If s is not a valid enum value, an error is returned.

func (*EnumFlag) String

func (f *EnumFlag) String() string

String returns the EnumValue's value as string.

func (*EnumFlag) Type

func (f *EnumFlag) Type() string

Type returns the valid enumeration values.

type LoaderFilter

type LoaderFilter struct {
	Ignore []string
}

LoaderFilter was taken from https://github.com/open-policy-agent/opa/blob/v0.31.0/cmd/filters.go#L13

func (LoaderFilter) Apply

func (f LoaderFilter) Apply(abspath string, info os.FileInfo, depth int) bool

type ProgressFunc

type ProgressFunc func() error

type RepeatedStringFlag

type RepeatedStringFlag struct {
	// contains filtered or unexported fields
}

func NewRepeatedStringFlag

func NewRepeatedStringFlag(defaultValue string) RepeatedStringFlag

func (*RepeatedStringFlag) IsSet

func (f *RepeatedStringFlag) IsSet() bool

func (*RepeatedStringFlag) Set

func (f *RepeatedStringFlag) Set(s string) error

func (*RepeatedStringFlag) String

func (f *RepeatedStringFlag) String() string

func (*RepeatedStringFlag) Strings

func (f *RepeatedStringFlag) Strings() []string

func (*RepeatedStringFlag) Type

func (f *RepeatedStringFlag) Type() string

type Templating

type Templating struct {
	RuleID       string
	RuleTitle    string
	RuleSeverity string
	Replace      func(string, string, string) string
}

Jump to

Keyboard shortcuts

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