parser

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadGlobal

func LoadGlobal(path string) (*alaye.Global, error)

LoadGlobal parses a global config file and validates its version.

func Marshal

func Marshal(writer io.Writer, input any) error

Marshal encodes input as HCL and writes it to writer.

func MarshalBytes

func MarshalBytes(input any) ([]byte, error)

MarshalBytes encodes input as HCL and returns the raw bytes.

func MarshalFile

func MarshalFile(path string, input any) error

MarshalFile encodes input as HCL and writes it atomically to path.

func ParseHostConfig

func ParseHostConfig(path string) (*alaye.Host, error)

ParseHostConfig parses a host config file.

func ValidateHCL

func ValidateHCL(data []byte) error

ValidateHCL reports whether data is syntactically valid HCL.

Types

type Parser

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

Parser reads and writes HCL config files.

func NewParser

func NewParser(path string) *Parser

func (*Parser) Marshal added in v0.1.2

func (p *Parser) Marshal(input any) error

Marshal encodes input as HCL and writes it atomically to p.path.

func (*Parser) Unmarshal

func (p *Parser) Unmarshal(output any) error

Unmarshal decodes the HCL file at p.path into output.

Jump to

Keyboard shortcuts

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