toml

package
v0.11.0-0.dev Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package toml converts TOML to and from CUE.

WARNING: THIS PACKAGE IS EXPERIMENTAL. ITS API MAY CHANGE AT ANY TIME.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

Decoder implements the decoding state.

Note that TOML files and streams never decode multiple CUE nodes; subsequent calls to Decoder.Decode may return io.EOF.

func NewDecoder

func NewDecoder(filename string, r io.Reader) *Decoder

NewDecoder creates a decoder from a stream of TOML input.

func (*Decoder) Decode

func (d *Decoder) Decode() (ast.Expr, error)

Decode parses the input stream as TOML and converts it to a CUE *ast.File. Because TOML files only contain a single top-level expression, subsequent calls to this method may return io.EOF.

type Encoder added in v0.10.0

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

Encoder implements the encoding state.

func NewEncoder added in v0.10.0

func NewEncoder(w io.Writer) *Encoder

NewEncoder creates an encoder to stream encoded TOML bytes.

func (*Encoder) Encode added in v0.10.0

func (e *Encoder) Encode(val cue.Value) error

Jump to

Keyboard shortcuts

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