toml

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package toml is driver use TOML format content as config source

Usage please see example:

Index

Constants

This section is empty.

Variables

View Source
var Decoder config.Decoder = func(blob []byte, ptr interface{}) (err error) {
	_, err = toml.Decode(string(blob), ptr)

	return
}

Decoder the toml content decoder

View Source
var Driver = &tomlDriver{config.Toml}

Driver for toml

View Source
var Encoder config.Encoder = func(ptr interface{}) (out []byte, err error) {
	buf := new(bytes.Buffer)

	err = toml.NewEncoder(buf).Encode(ptr)
	if err != nil {
		return
	}

	return buf.Bytes(), nil
}

Encoder the toml content encoder

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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