toml

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 1 Imported by: 0

README

toml

GoDoc

The toml package provides a config Decoder that unmarshals values from TOML formatted sources.

Example usage:

import (
    "fmt"

    "github.com/warthog618/config"
    "github.com/warthog618/config/blob"
    "github.com/warthog618/config/blob/decoder/toml"
    "github.com/warthog618/config/blob/loader/file"
)

func main() {
    c := config.New(blob.New(file.New("config.toml"), toml.NewDecoder()))
    s := c.MustGet("nested.string").String()
    fmt.Println("s:", s)
    // ....
}

Documentation

Overview

Package toml provides a TOML format decoder for config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct{}

Decoder provides the Decoder API required by config.Source.

func NewDecoder

func NewDecoder() Decoder

NewDecoder returns a TOML decoder.

func (Decoder) Decode

func (d Decoder) Decode(b []byte, v interface{}) error

Decode unmarshals an array of bytes containing TOML text.

Jump to

Keyboard shortcuts

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