xparser

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VarToJson

func VarToJson(value interface{}) ([]byte, error)

func VarToJsonIndent

func VarToJsonIndent(value interface{}) ([]byte, error)

func VarToJsonIndentString

func VarToJsonIndentString(value interface{}) (string, error)

func VarToJsonString

func VarToJsonString(value interface{}) (string, error)

func VarToStruct

func VarToStruct(value interface{}, obj interface{}) error

func VarToToml

func VarToToml(value interface{}) ([]byte, error)

func VarToXml

func VarToXml(value interface{}, rootTag ...string) ([]byte, error)

func VarToXmlIndent

func VarToXmlIndent(value interface{}, rootTag ...string) ([]byte, error)

func VarToYaml

func VarToYaml(value interface{}) ([]byte, error)

Types

type TParser

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

func Load

func Load(path string, unsafe ...bool) (*TParser, error)

func LoadContent

func LoadContent(data interface{}, unsafe ...bool) (*TParser, error)

func New

func New(value interface{}, unsafe ...bool) *TParser

func NewUnsafe

func NewUnsafe(value ...interface{}) *TParser

func (*TParser) Append

func (p *TParser) Append(pattern string, value interface{}) error

func (*TParser) Dump

func (p *TParser) Dump()

func (*TParser) Export

func (p *TParser) Export() string

func (*TParser) Get

func (p *TParser) Get(pattern string, def ...interface{}) interface{}

func (*TParser) GetArray

func (p *TParser) GetArray(pattern string, def ...interface{}) []interface{}

func (*TParser) GetBool

func (p *TParser) GetBool(pattern string, def ...interface{}) bool

func (*TParser) GetDuration

func (p *TParser) GetDuration(pattern string, def ...interface{}) time.Duration

func (*TParser) GetFloat32

func (p *TParser) GetFloat32(pattern string, def ...interface{}) float32

func (*TParser) GetFloat64

func (p *TParser) GetFloat64(pattern string, def ...interface{}) float64

func (*TParser) GetFloats

func (p *TParser) GetFloats(pattern string, def ...interface{}) []float64

func (*TParser) GetGTime

func (p *TParser) GetGTime(pattern string, format ...string) *xtime.Time

func (*TParser) GetInt

func (p *TParser) GetInt(pattern string, def ...interface{}) int

func (*TParser) GetInt16

func (p *TParser) GetInt16(pattern string, def ...interface{}) int16

func (*TParser) GetInt32

func (p *TParser) GetInt32(pattern string, def ...interface{}) int32

func (*TParser) GetInt64

func (p *TParser) GetInt64(pattern string, def ...interface{}) int64

func (*TParser) GetInt8

func (p *TParser) GetInt8(pattern string, def ...interface{}) int8

func (*TParser) GetInterfaces

func (p *TParser) GetInterfaces(pattern string, def ...interface{}) []interface{}

func (*TParser) GetInts

func (p *TParser) GetInts(pattern string, def ...interface{}) []int

func (*TParser) GetMap

func (p *TParser) GetMap(pattern string, def ...interface{}) map[string]interface{}

func (*TParser) GetString

func (p *TParser) GetString(pattern string, def ...interface{}) string

func (*TParser) GetStrings

func (p *TParser) GetStrings(pattern string, def ...interface{}) []string

func (*TParser) GetStruct

func (p *TParser) GetStruct(pattern string, pointer interface{}, mapping ...map[string]string) error

func (*TParser) GetStructDeep

func (p *TParser) GetStructDeep(pattern string, pointer interface{}, mapping ...map[string]string) error

func (*TParser) GetStructs

func (p *TParser) GetStructs(pattern string, pointer interface{}, mapping ...map[string]string) error

func (*TParser) GetStructsDeep

func (p *TParser) GetStructsDeep(pattern string, pointer interface{}, mapping ...map[string]string) error

func (*TParser) GetTime

func (p *TParser) GetTime(pattern string, format ...string) time.Time

func (*TParser) GetToStruct

func (p *TParser) GetToStruct(pattern string, pointer interface{}, mapping ...map[string]string) error

func (*TParser) GetToVar

func (p *TParser) GetToVar(pattern string, pointer interface{}) error

func (*TParser) GetUint

func (p *TParser) GetUint(pattern string, def ...interface{}) uint

func (*TParser) GetUint16

func (p *TParser) GetUint16(pattern string, def ...interface{}) uint16

func (*TParser) GetUint32

func (p *TParser) GetUint32(pattern string, def ...interface{}) uint32

func (*TParser) GetUint64

func (p *TParser) GetUint64(pattern string, def ...interface{}) uint64

func (*TParser) GetUint8

func (p *TParser) GetUint8(pattern string, def ...interface{}) uint8

func (*TParser) GetVar

func (p *TParser) GetVar(pattern string, def ...interface{}) *_type.TVar

func (*TParser) Len

func (p *TParser) Len(pattern string) int

func (*TParser) MarshalJSON

func (p *TParser) MarshalJSON() ([]byte, error)

func (*TParser) Remove

func (p *TParser) Remove(pattern string) error

func (*TParser) Set

func (p *TParser) Set(pattern string, value interface{}) error

func (*TParser) SetSplitChar

func (p *TParser) SetSplitChar(char byte)

设置子层访问符,默认为"."

func (*TParser) SetViolenceCheck

func (p *TParser) SetViolenceCheck(check bool)

是否启用访问子层, 默认false

func (*TParser) ToArray

func (p *TParser) ToArray() []interface{}

func (*TParser) ToJson

func (p *TParser) ToJson() ([]byte, error)

func (*TParser) ToJsonIndent

func (p *TParser) ToJsonIndent() ([]byte, error)

func (*TParser) ToJsonIndentString

func (p *TParser) ToJsonIndentString() (string, error)

func (*TParser) ToJsonString

func (p *TParser) ToJsonString() (string, error)

func (*TParser) ToMap

func (p *TParser) ToMap() map[string]interface{}

func (*TParser) ToStruct

func (p *TParser) ToStruct(pointer interface{}) error

func (*TParser) ToStructDeep

func (p *TParser) ToStructDeep(pointer interface{}) error

func (*TParser) ToStructs

func (p *TParser) ToStructs(pointer interface{}) error

func (*TParser) ToStructsDeep

func (p *TParser) ToStructsDeep(pointer interface{}) error

func (*TParser) ToToml

func (p *TParser) ToToml() ([]byte, error)

func (*TParser) ToXml

func (p *TParser) ToXml(rootTag ...string) ([]byte, error)

func (*TParser) ToXmlIndent

func (p *TParser) ToXmlIndent(rootTag ...string) ([]byte, error)

func (*TParser) ToYaml

func (p *TParser) ToYaml() ([]byte, error)

func (*TParser) Value

func (p *TParser) Value() interface{}

Jump to

Keyboard shortcuts

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