configutil

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const FormatTOML = "toml"

Variables

This section is empty.

Functions

func LoadTOMLFile

func LoadTOMLFile(name, path string) (*gconfig.Config, error)

func LoadTOMLString added in v1.11.0

func LoadTOMLString(name, text string) (*gconfig.Config, error)

LoadTOMLString parses TOML held in memory, for callers that already have the document text (the merge writer reads the file itself).

func NewTOMLManager

func NewTOMLManager(name string) *gconfig.Config

func SaveTOMLFile

func SaveTOMLFile(path string, cfg *gconfig.Config) error

Types

type Manager

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

func LoadManager

func LoadManager(name, path string) (*Manager, error)

func NewManager

func NewManager(name string) *Manager

func (*Manager) BindStruct

func (m *Manager) BindStruct(key string, dst any) error

func (*Manager) Config

func (m *Manager) Config() *gconfig.Config

func (*Manager) Data

func (m *Manager) Data() map[string]any

func (*Manager) Decode

func (m *Manager) Decode(dst any) error

func (*Manager) DumpTo

func (m *Manager) DumpTo(out io.Writer) (int64, error)

func (*Manager) Exists

func (m *Manager) Exists(key string, byPath bool) bool

func (*Manager) GetValue

func (m *Manager) GetValue(key string, byPath bool) (any, bool)

func (*Manager) MapOnExists

func (m *Manager) MapOnExists(key string, dst any) error

func (*Manager) SaveTo

func (m *Manager) SaveTo(path string) error

func (*Manager) Set

func (m *Manager) Set(key string, value any, byPath bool) error

func (*Manager) SetData

func (m *Manager) SetData(data map[string]any)

Jump to

Keyboard shortcuts

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