parser

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Path    string
	Content *ManifestNode
}

func (*Manifest) ToRego

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

func (*Manifest) UnmarshalYAML

func (m *Manifest) UnmarshalYAML(value *yaml.Node) error

type ManifestNode

type ManifestNode struct {
	StartLine int
	EndLine   int
	Offset    int
	Value     interface{}
	Type      TagType
	Path      string
}

func (*ManifestNode) ToRego

func (r *ManifestNode) ToRego() interface{}

func (*ManifestNode) UnmarshalYAML

func (r *ManifestNode) UnmarshalYAML(node *yaml.Node) error

type Parser

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

func New

func New(opts ...options.ParserOption) *Parser

New creates a new K8s parser

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader, path string) ([]interface{}, error)

func (*Parser) ParseFS

func (p *Parser) ParseFS(ctx context.Context, target fs.FS, path string) (map[string][]interface{}, error)

func (*Parser) ParseFile

func (p *Parser) ParseFile(_ context.Context, fsys fs.FS, path string) ([]interface{}, error)

ParseFile parses Kubernetes manifest from the provided filesystem path.

func (*Parser) SetDebugWriter

func (p *Parser) SetDebugWriter(writer io.Writer)

func (*Parser) SetSkipRequiredCheck

func (p *Parser) SetSkipRequiredCheck(b bool)

type TagType

type TagType string
const (
	TagBool   TagType = "!!bool"
	TagInt    TagType = "!!int"
	TagFloat  TagType = "!!float"
	TagStr    TagType = "!!str"
	TagString TagType = "!!string"
	TagSlice  TagType = "!!seq"
	TagMap    TagType = "!!map"
)

Jump to

Keyboard shortcuts

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