{"modulePath":"github.com/DoNewsCode/core","version":"v0.12.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package json\n\nPackage json provides the json codec.\n\nThe code and tests in this package is derived from [https://github.com/go-kratos/kratos](https://github.com/go-kratos/kratos) under MIT license [https://github.com/go-kratos/kratos/blob/main/LICENSE](https://github.com/go-kratos/kratos/blob/main/LICENSE)\n\n## Types\n\n```go\ntype Codec struct {\n\t// contains filtered or unexported fields\n}\n```\nCodec is a Codec implementation with json.\n\n```go\nfunc NewCodec(opts ...Option) Codec\n```\nNewCodec creates a new json codec\n\n```go\nfunc (c Codec) Marshal(v interface{}) ([]byte, error)\n```\nMarshal serialize the interface{} to \\[]byte\n\n```go\nfunc (c Codec) Unmarshal(data []byte, v interface{}) error\n```\nUnmarshal deserialize the \\[]byte to interface{}\n\n```go\ntype Option func(*Codec)\n```\nOption is the type of functional options to codec\n\n```go\nfunc WithIndent(indent string) Option\n```\nWithIndent allows the codec to indent json output while marshalling. It is useful when the json output is meant for humans to read.\n\n","path":"github.com/DoNewsCode/core/codec/json","name":"json","synopsis":"Package json provides the json codec.","isRedistributable":true}
