ini

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_NONE    = iota
	STATE_SECTION = iota
	STATE_VALUE   = iota

	MAX_LINE_LENGTH  = 2048
	BUFFER_LENGTH    = 512
	MAX_TOKEN_LENGTH = 128
	MAX_HOSTNAME_LEN = 128
	DEFAULT_CONFIG   = 0
)

Variables

This section is empty.

Functions

func Token

func Token(srcBuffer []byte, begin int, end int, toLower bool) (string, int)

Types

type CfgInfo

type CfgInfo map[CfgKey]SectionInfo

type CfgKey

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

type Config

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

func (*Config) Bool

func (c *Config) Bool(key string) bool

func (*Config) Float32

func (c *Config) Float32(key string) float32

func (*Config) Float64

func (c *Config) Float64(key string) float64

func (*Config) Get

func (c *Config) Get(key string) string

func (*Config) Get2

func (c *Config) Get2(key string, sep string) (string, string)

func (*Config) Get3

func (c *Config) Get3(seciton string, key string, sectionid ...int) string

func (*Config) Get5

func (c *Config) Get5(key string, sep string) []string

func (*Config) Get6

func (c *Config) Get6(section string, key string, sep string) []string

func (*Config) Int

func (c *Config) Int(key string) int

func (*Config) Int64

func (c *Config) Int64(key string) int64

func (*Config) Read

func (c *Config) Read(path string)

func (*Config) Time

func (c *Config) Time(key string) int64

type ICfonfig

type ICfonfig interface {
	Read(string)
	Get(key string) string                                    //获取key
	Get2(key string, sep string) (string, string)             //获取ip
	Get3(section string, key string, secitonId ...int) string //根据section, key, sectionid(从0开始)
	Get5(key string, sep string) []string                     //获取数组
	Get6(section string, key string, sep string) []string     //获取数组
	Int(key string) int
	Int64(key string) int64
	Float32(key string) float32
	Float64(key string) float64
	Bool(key string) bool
	Time(key string) int64
}

type SectionInfo

type SectionInfo map[string]string

Jump to

Keyboard shortcuts

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