toml

package
v2.367.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package toml provides TOML encoding helpers and adapters used by go-service.

This package integrates TOML encoding/decoding behind the go-service encoding abstraction.

Start with the package-level constructors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct{}

Encoder implements TOML encoding and decoding.

It uses BurntSushi/toml with default settings.

func NewEncoder

func NewEncoder() *Encoder

NewEncoder constructs a TOML encoder.

This encoder is a thin adapter around github.com/BurntSushi/toml that satisfies `github.com/alexfalkowski/go-service/v2/encoding.Encoder`.

func (*Encoder) Decode

func (e *Encoder) Decode(r io.Reader, v any) error

Decode reads TOML from r and decodes it into v.

In most cases v should be a pointer to the destination value (for example *MyStruct).

This method intentionally discards metadata returned by BurntSushi/toml and returns only the decode/unmarshal error (if any).

func (*Encoder) Encode

func (e *Encoder) Encode(w io.Writer, v any) error

Encode writes v to w as TOML.

This is a thin wrapper around `toml.NewEncoder(w).Encode(v)`.

Jump to

Keyboard shortcuts

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