{"modulePath":"github.com/AlaudaDevops/pkg","version":"v0.14.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package encoding\n\nPackage encoding provides some useful functions for encoding and decoding objects\n\n## Functions\n\n```go\nfunc Base64Decode(encodeStr string, obj interface{}) error\n```\nBase64Decode decode encodeStr using base64, and then use json to convert to obj.\n\n```go\nfunc Base64Encode(obj interface{}) (string, error)\n```\nBase64Encode convert obj to json string, and then encode it with base64.\n\n```go\nfunc ObjectToMap(obj interface{}) map[string]interface{}\n```\nObjectToMap convert an object to a map\\[string]interface{}\n\n## Types\n\n```go\ntype JsonPath struct {\n\t// PathFormat is the format of the path\n\tPathFormat func(string) string\n}\n```\nJsonPath object for json-path encoding and decoding\n\n```go\nfunc NewJsonPath() JsonPath\n```\nNewJsonPath construct json path\n\n```go\nfunc (p JsonPath) Decode(obj interface{}, data map[string]string) error\n```\nDecode decode json path to obj\n\n```go\nfunc (p JsonPath) Encode(obj interface{}) map[string]string\n```\nEncode encode obj to json path\n\n```go\ntype Node struct {\n\tName   string\n\tValue  string\n\tType   NodeType\n\tChilds map[string]*Node\n}\n```\n\n```go\nfunc NewRootNode() *Node\n```\n\n```go\nfunc (n *Node) Get(paths []string) *Node\n```\n\n```go\nfunc (n *Node) Json() string\n```\n\n```go\nfunc (n *Node) Set(path string, value string)\n```\n\n```go\ntype NodeType string\n```\n\n```go\nconst (\n\tNodeTypeRoot   NodeType = \"root\"\n\tNodeTypeArray  NodeType = \"array\"\n\tNodeTypeObject NodeType = \"object\"\n\tNodeTypeValue  NodeType = \"value\"\n)\n```\n\n","path":"github.com/AlaudaDevops/pkg/encoding","name":"encoding","synopsis":"Package encoding provides some useful functions for encoding and decoding objects","isRedistributable":true}
