corejson

package
v0.6.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type JsonContractsBinder added in v0.4.1

type JsonContractsBinder interface {
	Jsoner
	JsonMarshaller
	JsonParseSelfInjector
	AsJsonContractsBinder() JsonContractsBinder
}

type JsonMarshaller

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

type JsonParseSelfInjector added in v0.4.0

type JsonParseSelfInjector interface {
	JsonParseSelfInject(jsonResult *Result) error
}

type Jsoner

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

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 NewFromModel added in v0.3.4

func NewFromModel(model *ResultModel) *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 NewUsingBytesError added in v0.4.1

func NewUsingBytesError(bytesError *coredata.BytesError) Result

NewUsingBytesError Get created with nil.

func NewUsingBytesPtr added in v0.1.7

func NewUsingBytesPtr(
	jsonBytes *[]byte,
) *Result

func (*Result) AsJsonMarshaller added in v0.3.4

func (jsonResult *Result) AsJsonMarshaller() JsonMarshaller

func (*Result) AsJsonParseSelfInjector added in v0.3.4

func (jsonResult *Result) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*Result) AsJsoner added in v0.3.4

func (jsonResult *Result) AsJsoner() Jsoner

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) InjectInto added in v0.3.4

func (jsonResult *Result) InjectInto(
	injector JsonParseSelfInjector,
) error

func (*Result) IsEmptyError

func (jsonResult *Result) IsEmptyError() bool

func (*Result) IsEmptyJson

func (jsonResult *Result) IsEmptyJson() bool

func (*Result) IsEmptyJsonBytes

func (jsonResult *Result) IsEmptyJsonBytes() bool

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

func (*Result) Json added in v0.3.4

func (jsonResult *Result) Json() *Result

func (*Result) JsonModel added in v0.3.4

func (jsonResult *Result) JsonModel() *ResultModel

func (*Result) JsonModelAny added in v0.3.4

func (jsonResult *Result) JsonModelAny() interface{}

func (*Result) JsonParseSelfInject added in v0.3.4

func (jsonResult *Result) JsonParseSelfInject(
	jsonResultIn *Result,
) error

func (*Result) JsonString

func (jsonResult *Result) JsonString() string

func (*Result) JsonStringPtr

func (jsonResult *Result) JsonStringPtr() *string

func (*Result) MarshalJSON added in v0.3.4

func (jsonResult *Result) MarshalJSON() ([]byte, error)

func (*Result) MeaningfulError added in v0.4.1

func (jsonResult *Result) MeaningfulError() error

MeaningfulError create error even if results are nil.

func (*Result) ParseInjectUsingJson added in v0.3.4

func (jsonResult *Result) ParseInjectUsingJson(
	jsonResultIn *Result,
) (*Result, error)

ParseInjectUsingJson It will not update the self but creates a new one.

func (*Result) ParseInjectUsingJsonMust added in v0.3.4

func (jsonResult *Result) ParseInjectUsingJsonMust(
	jsonResultIn *Result,
) *Result

ParseInjectUsingJsonMust Panic if error

func (*Result) Unmarshal added in v0.3.1

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

func (*Result) UnmarshalJSON added in v0.3.4

func (jsonResult *Result) UnmarshalJSON(data []byte) error

type ResultModel added in v0.3.4

type ResultModel struct {
	Bytes    *[]byte
	Error    string
	HasError bool
}

func NewModel added in v0.3.4

func NewModel(result *Result) *ResultModel

type ResultsCollection added in v0.3.4

type ResultsCollection struct {
	Items *[]*Result `json:"JsonResultsCollection"`
}

func EmptyResultsCollection added in v0.3.4

func EmptyResultsCollection() *ResultsCollection

func NewResultsCollection added in v0.3.4

func NewResultsCollection(cap int) *ResultsCollection

func NewResultsCollectionUsingAnys added in v0.3.5

func NewResultsCollectionUsingAnys(
	addCapacity int,
	anys ...interface{},
) *ResultsCollection

func NewResultsCollectionUsingJsonResults added in v0.3.4

func NewResultsCollectionUsingJsonResults(
	addCapacity int,
	results ...*Result,
) *ResultsCollection

func NewResultsCollectionUsingJsoners added in v0.3.4

func NewResultsCollectionUsingJsoners(
	addCapacity int,
	jsoners ...Jsoner,
) *ResultsCollection

func (*ResultsCollection) Add added in v0.3.4

func (receiver *ResultsCollection) Add(
	result *Result,
) *ResultsCollection

func (*ResultsCollection) AddJsoner added in v0.3.4

func (receiver *ResultsCollection) AddJsoner(
	jsoners ...Jsoner,
) *ResultsCollection

AddJsoner skip on nil

func (*ResultsCollection) AddJsonerPtr added in v0.3.4

func (receiver *ResultsCollection) AddJsonerPtr(
	jsoners *[]Jsoner,
) *ResultsCollection

AddJsonerPtr skip on nil

func (*ResultsCollection) AddNonNilItems added in v0.3.4

func (receiver *ResultsCollection) AddNonNilItems(
	results ...*Result,
) *ResultsCollection

AddNonNilItems skip on nil

func (*ResultsCollection) AddNonNilItemsPtr added in v0.3.4

func (receiver *ResultsCollection) AddNonNilItemsPtr(
	results *[]*Result,
) *ResultsCollection

AddNonNilItemsPtr skip on nil

func (*ResultsCollection) AddResultsCollection added in v0.3.4

func (receiver *ResultsCollection) AddResultsCollection(
	collection *ResultsCollection,
) *ResultsCollection

AddResultsCollection skip on nil items

func (*ResultsCollection) AddSkipOnNil added in v0.3.5

func (receiver *ResultsCollection) AddSkipOnNil(
	result *Result,
) *ResultsCollection

AddSkipOnNil skip on nil

func (*ResultsCollection) Adds added in v0.3.4

func (receiver *ResultsCollection) Adds(
	results ...*Result,
) *ResultsCollection

func (*ResultsCollection) AddsAnys added in v0.3.5

func (receiver *ResultsCollection) AddsAnys(
	anys ...interface{},
) *ResultsCollection

AddsAnys Skip on nil

func (*ResultsCollection) AddsAnysPtr added in v0.3.5

func (receiver *ResultsCollection) AddsAnysPtr(
	anysPtr *[]interface{},
) *ResultsCollection

AddsAnysPtr Skip on nil

func (*ResultsCollection) AllErrors added in v0.3.4

func (receiver *ResultsCollection) AllErrors() (
	errListPtr *[]error,
	hasAnyError bool,
)

func (*ResultsCollection) AsJsonParseSelfInjector added in v0.3.4

func (receiver *ResultsCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*ResultsCollection) AsJsoner added in v0.3.4

func (receiver *ResultsCollection) AsJsoner() Jsoner

func (*ResultsCollection) Clear added in v0.3.4

func (receiver *ResultsCollection) Clear() *ResultsCollection

func (*ResultsCollection) GetAt added in v0.3.4

func (receiver *ResultsCollection) GetAt(
	index int,
) *Result

func (*ResultsCollection) GetAtSafe added in v0.3.4

func (receiver *ResultsCollection) GetAtSafe(
	index int,
) *Result

func (*ResultsCollection) GetAtSafeUsingLength added in v0.3.4

func (receiver *ResultsCollection) GetAtSafeUsingLength(
	index, length int,
) *Result

func (*ResultsCollection) GetErrorsAsSingle added in v0.3.4

func (receiver *ResultsCollection) GetErrorsAsSingle() error

func (*ResultsCollection) GetErrorsAsSingleString added in v0.3.4

func (receiver *ResultsCollection) GetErrorsAsSingleString() string

func (*ResultsCollection) GetErrorsStrings added in v0.3.5

func (receiver *ResultsCollection) GetErrorsStrings() *[]string

func (*ResultsCollection) GetStrings added in v0.3.4

func (receiver *ResultsCollection) GetStrings() *[]string

func (*ResultsCollection) HasError added in v0.3.4

func (receiver *ResultsCollection) HasError() bool

HasError has any error

func (*ResultsCollection) HasItems added in v0.3.4

func (receiver *ResultsCollection) HasItems() bool

func (*ResultsCollection) InjectIntoAt added in v0.3.4

func (receiver *ResultsCollection) InjectIntoAt(
	index int,
	injector JsonParseSelfInjector,
) error

func (*ResultsCollection) InjectIntoSameIndex added in v0.3.4

func (receiver *ResultsCollection) InjectIntoSameIndex(
	injectors ...JsonParseSelfInjector,
) (
	errListPtr *[]error,
	hasAnyError bool,
)

InjectIntoSameIndex any nil skip

func (*ResultsCollection) IsEmpty added in v0.3.4

func (receiver *ResultsCollection) IsEmpty() bool

func (*ResultsCollection) Json added in v0.3.4

func (receiver *ResultsCollection) Json() *Result

func (*ResultsCollection) JsonModel added in v0.3.4

func (receiver *ResultsCollection) JsonModel() *ResultsCollection

func (*ResultsCollection) JsonModelAny added in v0.3.4

func (receiver *ResultsCollection) JsonModelAny() interface{}

func (*ResultsCollection) JsonParseSelfInject added in v0.3.4

func (receiver *ResultsCollection) JsonParseSelfInject(
	jsonResult *Result,
) error

func (*ResultsCollection) Length added in v0.3.4

func (receiver *ResultsCollection) Length() int

func (*ResultsCollection) ParseInjectUsingJson added in v0.3.4

func (receiver *ResultsCollection) ParseInjectUsingJson(
	jsonResult *Result,
) (*ResultsCollection, error)

ParseInjectUsingJson It will not update the self but creates a new one.

func (*ResultsCollection) ParseInjectUsingJsonMust added in v0.3.4

func (receiver *ResultsCollection) ParseInjectUsingJsonMust(
	jsonResult *Result,
) *ResultsCollection

ParseInjectUsingJsonMust Panic if error

func (*ResultsCollection) UnmarshalAt added in v0.3.4

func (receiver *ResultsCollection) UnmarshalAt(
	index int,
	any interface{},
) error

func (*ResultsCollection) UnmarshalIntoSameIndex added in v0.3.4

func (receiver *ResultsCollection) UnmarshalIntoSameIndex(
	anys ...interface{},
) (
	errListPtr *[]error,
	hasAnyError bool,
)

UnmarshalIntoSameIndex any nil skip

Jump to

Keyboard shortcuts

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