types

package
v0.75.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 7 Imported by: 71

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFSKey

func CreateFSKey(filesystem fs.FS) string

func NewRange

func NewRange(filename string, startLine int, endLine int, sourcePrefix string, srcFS fs.FS) baseRange

func NewRangeWithFSKey

func NewRangeWithFSKey(filename string, startLine int, endLine int, sourcePrefix string, fsKey string, fs fs.FS) baseRange

func NewRangeWithLogicalSource

func NewRangeWithLogicalSource(filename string, startLine int, endLine int, sourcePrefix string,
	srcFS fs.FS) baseRange

Types

type BaseAttribute

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

func (BaseAttribute) GetMetadata

func (b BaseAttribute) GetMetadata() Metadata

type BoolValue

type BoolValue interface {
	Value() bool
	IsTrue() bool
	IsFalse() bool
	// contains filtered or unexported methods
}

func Bool

func Bool(value bool, metadata Metadata) BoolValue

func BoolDefault

func BoolDefault(value bool, metadata Metadata) BoolValue

func BoolExplicit

func BoolExplicit(value bool, metadata Metadata) BoolValue

func BoolUnresolvable

func BoolUnresolvable(m Metadata) BoolValue

type BytesValue

type BytesValue interface {
	Value() []byte
	Len() int
	// contains filtered or unexported methods
}

func Bytes

func Bytes(value []byte, m Metadata) BytesValue

func BytesDefault

func BytesDefault(value []byte, m Metadata) BytesValue

func BytesExplicit

func BytesExplicit(value []byte, m Metadata) BytesValue

func BytesUnresolvable

func BytesUnresolvable(m Metadata) BytesValue

type FakeReference

type FakeReference struct {
}

func (*FakeReference) LogicalID

func (f *FakeReference) LogicalID() string

func (*FakeReference) RefersTo

func (f *FakeReference) RefersTo(r Reference) bool

func (*FakeReference) String

func (f *FakeReference) String() string

type IntValue

type IntValue interface {
	Value() int
	EqualTo(i int) bool
	NotEqualTo(i int) bool
	LessThan(i int) bool
	GreaterThan(i int) bool
	// contains filtered or unexported methods
}

func Int

func Int(value int, m Metadata) IntValue

func IntDefault

func IntDefault(value int, m Metadata) IntValue

func IntExplicit

func IntExplicit(value int, m Metadata) IntValue

func IntFromInt32

func IntFromInt32(value int32, m Metadata) IntValue

func IntUnresolvable

func IntUnresolvable(m Metadata) IntValue

type MapValue

type MapValue interface {
	Value() map[string]string
	HasKey(key string) bool
	Len() int
	// contains filtered or unexported methods
}

func Map

func Map(value map[string]string, m Metadata) MapValue

func MapDefault

func MapDefault(value map[string]string, m Metadata) MapValue

func MapExplicit

func MapExplicit(value map[string]string, m Metadata) MapValue

type Metadata

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

func NewApiMetadata

func NewApiMetadata(provider string, parts ...string) Metadata

func NewExplicitMetadata

func NewExplicitMetadata(r Range, ref Reference) Metadata

func NewMetadata

func NewMetadata(r Range, ref Reference) Metadata

func NewRemoteMetadata

func NewRemoteMetadata(id string) Metadata

func NewTestMetadata

func NewTestMetadata() Metadata

func NewUnmanagedMetadata

func NewUnmanagedMetadata() Metadata

func NewUnresolvableMetadata

func NewUnresolvableMetadata(r Range, ref Reference) Metadata

func (Metadata) GetMetadata

func (m Metadata) GetMetadata() Metadata

func (Metadata) GetRawValue

func (m Metadata) GetRawValue() interface{}

func (Metadata) IsDefault

func (m Metadata) IsDefault() bool

func (Metadata) IsExplicit

func (m Metadata) IsExplicit() bool

func (Metadata) IsManaged

func (m Metadata) IsManaged() bool

func (Metadata) IsMultiLine

func (m Metadata) IsMultiLine() bool

func (Metadata) IsResolvable

func (m Metadata) IsResolvable() bool

func (Metadata) IsUnmanaged

func (m Metadata) IsUnmanaged() bool

func (Metadata) Parent

func (m Metadata) Parent() *Metadata

func (Metadata) Range

func (m Metadata) Range() Range

func (Metadata) Reference

func (m Metadata) Reference() Reference

func (Metadata) Root added in v0.72.0

func (m Metadata) Root() Metadata

func (Metadata) String

func (m Metadata) String() string

func (*Metadata) ToRego

func (m *Metadata) ToRego() interface{}

func (Metadata) WithParent

func (m Metadata) WithParent(p Metadata) Metadata

type NamedReference

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

func (*NamedReference) LogicalID

func (f *NamedReference) LogicalID() string

func (*NamedReference) RefersTo

func (f *NamedReference) RefersTo(r Reference) bool

func (*NamedReference) String

func (f *NamedReference) String() string

type Range

type Range interface {
	GetFilename() string
	GetLocalFilename() string
	GetSourcePrefix() string
	GetFS() fs.FS
	GetFSKey() string
	GetStartLine() int
	GetEndLine() int
	String() string
	IsMultiLine() bool
	LineCount() int
}

type Reference

type Reference interface {
	String() string
	LogicalID() string
	RefersTo(r Reference) bool
}

func NewNamedReference

func NewNamedReference(name string) Reference

type Source

type Source string
const (
	SourceTerraform      Source = "terraform"
	SourceDockerfile     Source = "dockerfile"
	SourceKubernetes     Source = "kubernetes"
	SourceRbac           Source = "rbac"
	SourceCloudFormation Source = "cloudformation"
	SourceAnsible        Source = "ansible"
	SourceDefsec         Source = "defsec"
	SourceYAML           Source = "yaml"
	SourceJSON           Source = "json"
	SourceTOML           Source = "toml"
)

type StringEqualityOption

type StringEqualityOption int
const (
	IgnoreCase StringEqualityOption = iota
	IsPallindrome
	IgnoreWhitespace
)

type StringValue

type StringValue interface {
	Value() string
	IsEmpty() bool
	IsNotEmpty() bool
	IsOneOf(values ...string) bool
	EqualTo(value string, equalityOptions ...StringEqualityOption) bool
	NotEqualTo(value string, equalityOptions ...StringEqualityOption) bool
	StartsWith(prefix string, equalityOptions ...StringEqualityOption) bool
	EndsWith(suffix string, equalityOptions ...StringEqualityOption) bool
	Contains(value string, equalityOptions ...StringEqualityOption) bool
	// contains filtered or unexported methods
}

func String

func String(str string, m Metadata) StringValue

func StringDefault

func StringDefault(value string, m Metadata) StringValue

func StringExplicit

func StringExplicit(value string, m Metadata) StringValue

func StringUnresolvable

func StringUnresolvable(m Metadata) StringValue

type StringValueList

type StringValueList []StringValue

func (StringValueList) AsStrings

func (l StringValueList) AsStrings() (output []string)

type TimeValue

type TimeValue interface {
	Value() *time.Time
	Before(i time.Time) bool
	After(i time.Time) bool
	IsNever() bool
	// contains filtered or unexported methods
}

func Time

func Time(value time.Time, m Metadata) TimeValue

func TimeDefault

func TimeDefault(value time.Time, m Metadata) TimeValue

func TimeExplicit

func TimeExplicit(value time.Time, m Metadata) TimeValue

func TimeUnresolvable

func TimeUnresolvable(m Metadata) TimeValue

Jump to

Keyboard shortcuts

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