jsonhooks

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

Akamai JSONHooks

Documentation

Overview

Package jsonhooks adds hooks that are automatically called before JSON marshaling (PreMarshalJSON) and after JSON unmarshaling (PostUnmarshalJSON). It does not do so recursively.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImplementsPostJSONUnmarshaler

func ImplementsPostJSONUnmarshaler(v interface{}) bool

ImplementsPostJSONUnmarshaler checks for support for the PostUnmarshalJSON post-hook

func ImplementsPreJSONMarshaler

func ImplementsPreJSONMarshaler(v interface{}) bool

ImplementsPreJSONMarshaler checks for support for the PreMarshalJSON pre-hook

func Marshal

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

Marshal wraps encoding/json.Marshal, calls v.PreMarshalJSON() if it exists

func Unmarshal

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

Unmarshal wraps encoding/json.Unmarshal, calls v.PostUnmarshalJSON() if it exists

Types

type PostJSONUnmarshaler

type PostJSONUnmarshaler interface {
	PostUnmarshalJSON() error
}

PostJSONUnmarshaler infers support for the PostUnmarshalJSON post-hook

type PreJSONMarshaler

type PreJSONMarshaler interface {
	PreMarshalJSON() error
}

PreJSONMarshaler infers support for the PreMarshalJSON pre-hook

Jump to

Keyboard shortcuts

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