json

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFromString

func DecodeFromString(s string, v interface{}) error

DecodeFromString decodes JSON data from a string into the provided value.

func EncodeToString

func EncodeToString(v interface{}) (string, error)

EncodeToString marshals and encodes the provided value directly into a string.

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal safely marshals the provided value to JSON.

func PrettyPrint

func PrettyPrint(v interface{}) (string, error)

PrettyPrint marshals the provided value into a pretty-printed JSON string.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal safely unmarshals the provided JSON data into the provided value.

func ValidateJSON

func ValidateJSON(data []byte) error

ValidateJSON checks if the provided byte slice is valid JSON.

func ValidateJSONString

func ValidateJSONString(s string) error

ValidateJSONString checks if the provided string is valid JSON.

Types

type Decoder

type Decoder = json.Decoder

Type aliases to maintain compatibility with the json package types.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder initializes and returns a new JSON Decoder.

type Delim

type Delim = json.Delim

Type aliases to maintain compatibility with the json package types.

type Encoder

type Encoder = json.Encoder

Type aliases to maintain compatibility with the json package types.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder initializes and returns a new JSON Encoder.

type Marshaler

type Marshaler = json.Marshaler

Type aliases to maintain compatibility with the json package types.

type Number

type Number = json.Number

Type aliases to maintain compatibility with the json package types.

type RawMessage

type RawMessage = json.RawMessage

Type aliases to maintain compatibility with the json package types.

type UnmarshalTypeError

type UnmarshalTypeError = json.UnmarshalTypeError

Type aliases to maintain compatibility with the json package types.

type Unmarshaler

type Unmarshaler = json.Unmarshaler

Type aliases to maintain compatibility with the json package types.

Jump to

Keyboard shortcuts

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