Categorygithub.com/amarin/payload
modulepackage
0.1.1
Repository: https://github.com/amarin/payload.git
Documentation: pkg.go.dev

# README

payload

Package provides utility type and functions to deal with JSON data stored as byte array. It wraps and uses awesome github.com/tidwall/sjson and github.com/tidwall/sjson packages and its types.

# Functions

ExtendJSON extend existing raw JSON message of json.RawMessage with specified data, doing keys unpacking by dot separator, f.e.
Load loads payload.RawMessage message from specified path.
MakeJSON prepares json.RawMessage suitable to use as request data or response result.
MakeRawMessage creates new RawMessage using specified data mapping.
MustExtendJSON extend existing raw JSON message of json.RawMessage with specified data, doing keys unpacking by dot separator, f.e.
MustLoad loads payload.RawMessage message from specified file path.
MustSave saves RawMessage data into specified file path.
NewJSON prepares json.RawMessage suitable to use as request data or response result.
NewRawMessage creates new RawMessage using specified data mapping.
Save stores RawMessage data into specified file path.
Wrap makes an RawMessage from provided json.RawMessage.

# Constants

EmptyJSONObject contains empty JSON object string representation.

# Variables

Error indicates payload routines errors.

# Type aliases

DataMap maps string path elements to its values.
RawMessage extends basic json.RawMessage with extraction and manipulation methods of gjson/sjson.