ini

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 7 Imported by: 6

Documentation

Overview

cache ini to memory

read ini directly from file

read ini from file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*goini.File
	// contains filtered or unexported fields
}

func GetFile added in v0.0.2

func GetFile(fileName string) (*File, error)

func (*File) Bool

func (f *File) Bool(section, key string) bool

func (*File) Duration

func (f *File) Duration(section, key string) time.Duration

func (*File) Float64

func (f *File) Float64(section, key string) float64

func (*File) Int

func (f *File) Int(section, key string) int

func (*File) Int64

func (f *File) Int64(section, key string) int64

func (*File) String

func (f *File) String(section, key string) string

func (*File) Time

func (f *File) Time(section, key string) time.Time

func (*File) TimeFormat

func (f *File) TimeFormat(section, key, format string) time.Time

func (*File) Uint

func (f *File) Uint(section, key string) uint

func (*File) Uint64

func (f *File) Uint64(section, key string) uint64

type Ini

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

用于省略前缀长路径写法 例如,以下可用于多语言处理: ini := NewIni(conf.RootDir()+"/app.default) lang := ".zh_cn" cfg := ini.GetFile(lang) cfg.String("msg", "1001")

func NewIni

func NewIni(rootPath string) *Ini

func (*Ini) GetDefaultFile

func (ini *Ini) GetDefaultFile(subFileName, subDefaultFileName string) *File

func (*Ini) GetFile

func (ini *Ini) GetFile(subFileName string) *File

type IniCache added in v0.0.2

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

func NewIniCache added in v0.0.2

func NewIniCache(rootPath string) *IniCache

func NewTimeoutIniCache added in v0.0.3

func NewTimeoutIniCache(rootPath string, timeout time.Duration) *IniCache

rootPath -- point out the etc directory timeout -- reread init file afeter timeout

func (*IniCache) ClearCache added in v0.0.3

func (ini *IniCache) ClearCache()

func (*IniCache) DelCache added in v0.0.2

func (ini *IniCache) DelCache(subFileName string)

func (*IniCache) GetDefaultFile added in v0.0.2

func (ini *IniCache) GetDefaultFile(subFileName, subDefaultFileName string) *File

func (*IniCache) GetFile added in v0.0.2

func (ini *IniCache) GetFile(subFileName string) *File

func (*IniCache) Reload added in v0.0.3

func (ini *IniCache) Reload(subFileName string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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