gf: github.com/gogf/gf/encoding/gparser Index | Files

package gparser

import "github.com/gogf/gf/encoding/gparser"

Package gparser provides convenient API for accessing/converting variable and JSON/XML/YAML/TOML.

Index

Package Files

gparser.go gparser_api_encoding.go gparser_api_new_load.go

func MustToIni Uses

func MustToIni(value interface{}) []byte

func MustToIniString Uses

func MustToIniString(value interface{}) string

func MustToJson Uses

func MustToJson(value interface{}) []byte

func MustToJsonIndent Uses

func MustToJsonIndent(value interface{}) []byte

func MustToJsonIndentString Uses

func MustToJsonIndentString(value interface{}) string

func MustToJsonString Uses

func MustToJsonString(value interface{}) string

func MustToToml Uses

func MustToToml(value interface{}) []byte

func MustToTomlString Uses

func MustToTomlString(value interface{}) string

func MustToXml Uses

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

func MustToXmlIndent Uses

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

func MustToXmlIndentString Uses

func MustToXmlIndentString(value interface{}, rootTag ...string) string

func MustToXmlString Uses

func MustToXmlString(value interface{}, rootTag ...string) string

func MustToYaml Uses

func MustToYaml(value interface{}) []byte

func MustToYamlString Uses

func MustToYamlString(value interface{}) string

func VarToIni Uses

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

func VarToIniString Uses

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

func VarToJson Uses

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

func VarToJsonIndent Uses

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

func VarToJsonIndentString Uses

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

func VarToJsonString Uses

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

func VarToToml Uses

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

func VarToTomlString Uses

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

func VarToXml Uses

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

func VarToXmlIndent Uses

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

func VarToXmlIndentString Uses

func VarToXmlIndentString(value interface{}, rootTag ...string) (string, error)

func VarToXmlString Uses

func VarToXmlString(value interface{}, rootTag ...string) (string, error)

func VarToYaml Uses

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

func VarToYamlString Uses

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

type Parser Uses

type Parser = gjson.Json

Parser is actually alias of gjson.Json.

func Load Uses

func Load(path string, safe ...bool) (*Parser, error)

Load loads content from specified file <path>, and creates a Parser object from its content.

func LoadContent Uses

func LoadContent(data interface{}, safe ...bool) (*Parser, error)

LoadContent creates a Parser object from given content, it checks the data type of <content> automatically, supporting JSON, XML, INI, YAML and TOML types of data.

func LoadIni Uses

func LoadIni(data interface{}, safe ...bool) (*Parser, error)

func LoadJson Uses

func LoadJson(data interface{}, safe ...bool) (*Parser, error)

func LoadToml Uses

func LoadToml(data interface{}, safe ...bool) (*Parser, error)

func LoadXml Uses

func LoadXml(data interface{}, safe ...bool) (*Parser, error)

func LoadYaml Uses

func LoadYaml(data interface{}, safe ...bool) (*Parser, error)

func New Uses

func New(data interface{}, safe ...bool) *Parser

New creates a Parser object with any variable type of <data>, but <data> should be a map, struct or slice for data access reason, or it will make no sense.

The parameter <safe> specifies whether using this Json object in concurrent-safe context, which is false in default.

func NewWithTag Uses

func NewWithTag(data interface{}, tags string, safe ...bool) *Parser

NewWithTag creates a Parser object with any variable type of <data>, but <data> should be a map or slice for data access reason, or it will make no sense.

The parameter <tags> specifies priority tags for struct conversion to map, multiple tags joined with char ','.

The parameter <safe> specifies whether using this Json object in concurrent-safe context, which is false in default.

Package gparser imports 1 packages (graph) and is imported by 2 packages. Updated 2020-09-15. Refresh now. Tools for package owners.