lyml

package
v0.4.2 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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVar

func GetVar(ctx context.Context, key string) lua.LValue

Gets a variable from the context.

func Load

func Load(path string, v any) error

func LoadContext

func LoadContext(ctx context.Context, path string, v any) error

Load is unmarshal with file path.

func NewContextMetatable

func NewContextMetatable() *lua.LTable

func NewContextVM

func NewContextVM(ctx context.Context) *lua.LState

Creates a new VM with a context.

func Render

func Render(lyml []byte) (res []byte, err error)

func RenderContext

func RenderContext(ctx context.Context, lyml []byte) (res []byte, err error)

Render takes a lyml document and returns a valid yml document with all special nodes evaluated.

func SetVar

func SetVar(key string, value any) error

func SetVars

func SetVars(vars map[string]any) error

func Transform

func Transform(lyml []byte) (res *yaml.Node, err error)

func TransformContext

func TransformContext(ctx context.Context, lyml []byte) (res *yaml.Node, err error)

Transform takes a lyml document and returns the parsed yaml.Node.

func Unmarshal

func Unmarshal(data []byte, v any) error

func UnmarshalContext

func UnmarshalContext(ctx context.Context, data []byte, v any) error

Unmarshal transforms a lyml document into a yml one and then unmarshals it into the given value.

func WithVar

func WithVar(ctx context.Context, key string, value any) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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