Documentation ¶
Index ¶
- Constants
- Variables
- func NewSection(k, v string) *sectionConfig
- func SaveConfigToFile(cf *IniConfig, filename string) bool
- type IniConfig
- func (cf *IniConfig) DelConfigData(secting, name string) bool
- func (cf *IniConfig) GetConfig(secting, name string, defV string) string
- func (cf *IniConfig) GetConfigDouble(secting, name string, defV float64) float64
- func (cf *IniConfig) GetConfigInt(secting, name string, defV int) int
- func (cf *IniConfig) PutConfig(secting, name, val string) bool
Constants ¶
View Source
const ( DEFAULT_NAME = "default_key" SectionComment = "comment-section-%s" )
Variables ¶
View Source
var ( FORMAT_ERROR = errors.New("ini format error") NOT_FOUND = errors.New("not found config") )
Functions ¶
func SaveConfigToFile ¶
将数据写入到文件, 无法保证配置的顺序
Types ¶
type IniConfig ¶
type IniConfig struct {
Sections map[string]sectionConfigs
}
func (*IniConfig) DelConfigData ¶
删除配置
func (*IniConfig) GetConfigDouble ¶
获取配置的各种方式 double, defV 为默认
func (*IniConfig) GetConfigInt ¶
获取配置的各种方式 int, defV 为默认
Click to show internal directories.
Click to hide internal directories.