data

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Raw

type Raw []byte

Raw is a type based on []byte with custom UnmarshalJSON and MarshalJSON methods to handle double escaped JSON and raw data.

func (Raw) MarshalJSON

func (r Raw) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler. If valid JSON is provided it will be escaped and returned as a JSON string, otherwise return the data as is.

func (*Raw) UnmarshalJSON

func (r *Raw) UnmarshalJSON(b []byte) error

UnmarshalJSON satisfies json.Unmarshaler. It unquotes escaped JSON if it's escaped, otherwise sets the data as is.

Jump to

Keyboard shortcuts

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