settings

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 6 Imported by: 0

README

settings

load config

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	// Load config load
	Load() error

	// IsSet is set value
	IsSet(key string) bool

	// ReadSection read val by key,val must be a pointer
	ReadSection(key string, val interface{}) error

	// Store save config to file
	Store(path string) error
}

Config interface associated with reading/saving configuration files.

func Load added in v1.0.2

func Load(path string, opts ...Option) (Config, error)

Load 加载配置文件内容,返回Config接口

func New

func New(opts ...Option) Config

New create a config interface.

type Option

type Option func(*Options)

Option for ConfigOption

func WithConfigFile

func WithConfigFile(configFile string) Option

WithConfigFile set config filename

func WithWatchFile

func WithWatchFile() Option

WithWatchFile watch file change

type Options

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

Options config option

Jump to

Keyboard shortcuts

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