parser

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigCommonBodySchema = &hcl.BodySchema{
	Blocks: []hcl.BlockHeaderSchema{
		{
			Type: "sentinel",
		},
		{
			Type:       "policy",
			LabelNames: []string{"name"},
		},
		{
			Type:       "module",
			LabelNames: []string{"name"},
		},
		{
			Type:       "mock",
			LabelNames: []string{"name"},
		},
		{
			Type:       "global",
			LabelNames: []string{"name"},
		},
		{
			Type:       "param",
			LabelNames: []string{"name"},
		},
		{
			Type: "test",
		},
	},
}
View Source
var EmptyBodySchema = &hcl.BodySchema{}
View Source
var GlobalBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "value",
			Required: false,
		},
	},
}
View Source
var MockBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "data",
			Required: false,
		},
	},
	Blocks: []hcl.BlockHeaderSchema{
		{
			Type: "module",
		},
	},
}
View Source
var MockModuleBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "source",
			Required: false,
		},
	},
}
View Source
var ParamBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "value",
			Required: false,
		},
	},
}
View Source
var PolicyBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "source",
			Required: false,
		},
		{
			Name:     "enforcement_level",
			Required: false,
		},
		{
			Name:     "params",
			Required: false,
		},
	},
}
View Source
var SentinelBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "features",
			Required: false,
		},
	},
}
View Source
var TestBlockSchema = &hcl.BodySchema{
	Attributes: []hcl.AttributeSchema{
		{
			Name:     "rules",
			Required: false,
		},
	},
}
View Source
var V1ImportBodySchema = &hcl.BodySchema{
	Blocks: []hcl.BlockHeaderSchema{v1ImportBlockHeaderSchema},
}

Functions

func AttemptOverrideFileWith

func AttemptOverrideFileWith(this, other *ast.File, sentinelVersion string) diagnostics.Diagnostics

func IsStdLibName

func IsStdLibName(value string) bool

func New

func New(sentinelVersion string) (sentinel_config.Parser, error)

func OverrideFileWith

func OverrideFileWith(this, other *ast.File, sentinelVersion string) diagnostics.Diagnostics

func ParseFile

func ParseFile(
	sentinelVersion,
	filename string,
	src []byte,
) (*ast.File, diagnostics.Diagnostics, error)

func ValidateFile

func ValidateFile(file *ast.File, sentinelVersion string) diagnostics.Diagnostics

Types

This section is empty.

Jump to

Keyboard shortcuts

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