Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶ added in v0.9.19
func Format(t Table, options ...FormatOptionsF) string
Format 把 Table 格式化为字符串
func FormatWithGroups ¶ added in v0.9.19
func FormatWithGroups(opt *FormatOptions)
FormatWithGroups 启用分组功能
Types ¶
type FormatOptions ¶ added in v0.9.19
type FormatOptions struct {
// contains filtered or unexported fields
}
FormatOptions ...
type FormatOptionsF ¶ added in v0.9.19
type FormatOptionsF func(opt *FormatOptions)
FormatOptionsF ...
type Getter ¶ added in v0.9.14
type Getter interface {
Required() Getter
Optional() Getter
Error() error
GetBool(name string, defaultValue ...bool) bool
GetByte(name string, defaultValue ...byte) byte
GetRune(name string, defaultValue ...rune) rune
GetString(name string, defaultValue ...string) string
GetStringList(name string, defaultValue ...string) []string
GetFloat32(name string, defaultValue ...float32) float32
GetFloat64(name string, defaultValue ...float64) float64
GetInt(name string, defaultValue ...int) int
GetInt8(name string, defaultValue ...int8) int8
GetInt16(name string, defaultValue ...int16) int16
GetInt32(name string, defaultValue ...int32) int32
GetInt64(name string, defaultValue ...int64) int64
GetUint(name string, defaultValue ...uint) uint
GetUint8(name string, defaultValue ...uint8) uint8
GetUint16(name string, defaultValue ...uint16) uint16
GetUint32(name string, defaultValue ...uint32) uint32
GetUint64(name string, defaultValue ...uint64) uint64
}
Getter 属性值读取器
type Setter ¶ added in v0.9.14
type Setter interface {
SetBool(name string, value bool)
SetByte(name string, value byte)
SetRune(name string, value rune)
SetString(name string, value string)
SetStringList(name string, value []string)
SetFloat32(name string, value float32)
SetFloat64(name string, value float64)
SetInt(name string, value int)
SetInt8(name string, value int8)
SetInt16(name string, value int16)
SetInt32(name string, value int32)
SetInt64(name string, value int64)
SetUint(name string, value uint)
SetUint8(name string, value uint8)
SetUint16(name string, value uint16)
SetUint32(name string, value uint32)
SetUint64(name string, value uint64)
}
Setter 属性值设置器
type Table ¶
type Table interface {
Mode() safe.Mode
Names() []string
Exists(name string) bool
Clear()
Remove(name string) bool
GetProperty(name string) string
GetPropertyRequired(name string) (string, error)
GetPropertyOptional(name string, defaultValue string) string
SetProperty(name string, value string)
Export(dst map[string]string) map[string]string
Import(src map[string]string)
Getter() Getter
Setter() Setter
}
Table 表示一个属性的集合
func LoadFromResource ¶ added in v0.9.8
LoadFromResource 从资源中加载属性表
Click to show internal directories.
Click to hide internal directories.