corejson

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 4 Imported by: 116

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type JsonMarshaller

type JsonMarshaller interface {
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
}

type Jsoner

type Jsoner interface {
	Json() *Result
	JsonModelAny() interface{}
}

type ParseSelfInjector

type ParseSelfInjector interface {
	JsonParseSelfInject(jsonResult *Result)
}

type Result

type Result struct {
	Bytes *[]byte
	Error error
	// contains filtered or unexported fields
}

func EmptyWithError added in v0.1.7

func EmptyWithError(err error) Result

func EmptyWithErrorPtr added in v0.1.7

func EmptyWithErrorPtr(err error) *Result

func EmptyWithoutErrorPtr added in v0.1.7

func EmptyWithoutErrorPtr() *Result

func New added in v0.1.7

func New(jsonBytes []byte, err error) Result

func NewFromAny added in v0.3.1

func NewFromAny(any interface{}) *Result

func NewPtr added in v0.1.7

func NewPtr(jsonBytes []byte, err error) *Result

func NewPtrUsingBytesPtr added in v0.1.7

func NewPtrUsingBytesPtr(jsonBytes *[]byte, err error) *Result

func NewUsingBytes added in v0.1.7

func NewUsingBytes(jsonBytes *[]byte) Result

func NewUsingBytesPtr added in v0.1.7

func NewUsingBytesPtr(jsonBytes *[]byte) *Result

func (*Result) HandleError

func (jsonResult *Result) HandleError()

func (*Result) HandleErrorWithMsg

func (jsonResult *Result) HandleErrorWithMsg(msg string)

func (*Result) HasBytes

func (jsonResult *Result) HasBytes() bool

func (*Result) HasError

func (jsonResult *Result) HasError() bool

func (*Result) HasJson

func (jsonResult *Result) HasJson() bool

func (*Result) IsEmptyError

func (jsonResult *Result) IsEmptyError() bool

func (*Result) IsEmptyJson

func (jsonResult *Result) IsEmptyJson() bool

func (*Result) IsEmptyJsonBytes

func (jsonResult *Result) IsEmptyJsonBytes() bool

len == 0, nil, {} returns as empty true

func (*Result) JsonString

func (jsonResult *Result) JsonString() string

func (*Result) JsonStringPtr

func (jsonResult *Result) JsonStringPtr() *string

func (*Result) Unmarshal added in v0.3.1

func (jsonResult *Result) Unmarshal(any interface{}) error

Jump to

Keyboard shortcuts

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