qconfig

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig added in v0.0.8

func LoadConfig(cfgFile string, sectionName string, cfgObjPtr any) error

LoadConfig 统一的配置加载方法 cfgFile: 配置文件路径 sectionName: 配置节名称 cfgObjPtr: 配置对象

func SaveConfig added in v0.0.8

func SaveConfig(filePath string, saveContent SaveContent) error

SaveConfig 保存配置文件 filePath: 配置文件路径 saveConfigs: 配置映射,key为配置节名称,如Base,模块名称等;value为配置内容

Types

type SaveContent added in v0.1.0

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

SaveContent 配置内容

func (*SaveContent) Add added in v0.1.0

func (sc *SaveContent) Add(sectionName string, sectionDesc string, content any)

Add 添加配置

func (*SaveContent) AddWithExclude added in v0.1.0

func (sc *SaveContent) AddWithExclude(sectionName string, sectionDesc string, content any, excludeFields []string)

AddWithExclude 添加配置,并指定需要排除的字段

Jump to

Keyboard shortcuts

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