corejson

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 16 Imported by: 116

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Empty                   = emptyCreator{}
	Serialize               = serializerLogic{}   // deals with json.Marshal
	Deserialize             = deserializerLogic{} // deals with json.Unmarshal
	NewResult               = newResultCreator{}
	NewResultsCollection    = newResultsCollectionCreator{}
	NewBytesCollection      = newBytesCollectionCreator{}
	NewResultsPtrCollection = newResultsPtrCollectionCreator{}
	NewMapResults           = newMapResultsCreator{}
	StaticJsonError         = errcore.
							EmptyResultCannotMakeJsonType.
							ErrorNoRefs(constants.EmptyString)
)

Functions

func BytesCloneIf added in v0.9.8

func BytesCloneIf(
	isDeepClone bool,
	inputBytes []byte,
) []byte

func BytesDeepClone added in v1.1.3

func BytesDeepClone(
	inputBytes []byte,
) []byte

Types

type BytesCollection added in v0.9.8

type BytesCollection struct {
	Items [][]byte `json:"JsonBytesCollection"`
}

func (*BytesCollection) Add added in v0.9.8

func (it *BytesCollection) Add(
	result []byte,
) *BytesCollection

func (*BytesCollection) AddAny added in v0.9.8

func (it *BytesCollection) AddAny(
	any interface{},
) error

func (*BytesCollection) AddAnyItems added in v0.9.8

func (it *BytesCollection) AddAnyItems(
	anyItems ...interface{},
) error

func (*BytesCollection) AddBytesCollection added in v0.9.8

func (it *BytesCollection) AddBytesCollection(
	collection *BytesCollection,
) *BytesCollection

AddBytesCollection skip on nil items

func (*BytesCollection) AddJsoners added in v0.9.8

func (it *BytesCollection) AddJsoners(
	isIgnoreNilOrError bool,
	jsoners ...Jsoner,
) *BytesCollection

AddJsoners skip on nil

func (*BytesCollection) AddMapResults added in v0.9.8

func (it *BytesCollection) AddMapResults(
	mapResults *MapResults,
) *BytesCollection

func (*BytesCollection) AddNonEmpty added in v0.9.8

func (it *BytesCollection) AddNonEmpty(
	rawBytes []byte,
) *BytesCollection

AddNonEmpty

skip on empty

func (*BytesCollection) AddPtr added in v0.9.8

func (it *BytesCollection) AddPtr(
	rawBytes *[]byte,
) *BytesCollection

func (*BytesCollection) AddRawMapResults added in v0.9.8

func (it *BytesCollection) AddRawMapResults(
	mapResults map[string]Result,
) *BytesCollection

func (*BytesCollection) AddResult added in v0.9.8

func (it *BytesCollection) AddResult(
	result Result,
) *BytesCollection

AddResult

skip on empty or has issue

func (*BytesCollection) AddResultPtr added in v0.9.8

func (it *BytesCollection) AddResultPtr(
	result *Result,
) *BytesCollection

AddResultPtr

skip on empty or has issue

func (*BytesCollection) AddSkipOnNil added in v0.9.8

func (it *BytesCollection) AddSkipOnNil(
	rawBytes []byte,
) *BytesCollection

AddSkipOnNil skip on nil

func (*BytesCollection) Adds added in v0.9.8

func (it *BytesCollection) Adds(
	rawBytesCollection ...[]byte,
) *BytesCollection

func (*BytesCollection) AddsPtr added in v0.9.8

func (it *BytesCollection) AddsPtr(
	results ...*Result,
) *BytesCollection

func (*BytesCollection) AsJsonContractsBinder added in v0.9.8

func (it *BytesCollection) AsJsonContractsBinder() JsonContractsBinder

func (*BytesCollection) AsJsonParseSelfInjector added in v0.9.8

func (it *BytesCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*BytesCollection) AsJsoner added in v0.9.8

func (it *BytesCollection) AsJsoner() Jsoner

func (*BytesCollection) Clear added in v0.9.8

func (it *BytesCollection) Clear() *BytesCollection

func (BytesCollection) Clone added in v0.9.8

func (it BytesCollection) Clone(isDeepCloneEach bool) BytesCollection

func (*BytesCollection) ClonePtr added in v0.9.8

func (it *BytesCollection) ClonePtr(isDeepCloneEach bool) *BytesCollection

func (*BytesCollection) Dispose added in v0.9.8

func (it *BytesCollection) Dispose()

func (*BytesCollection) FirstOrDefault added in v0.9.8

func (it *BytesCollection) FirstOrDefault() []byte

func (*BytesCollection) GetAt added in v0.9.8

func (it *BytesCollection) GetAt(
	index int,
) []byte

func (*BytesCollection) GetAtSafe added in v0.9.8

func (it *BytesCollection) GetAtSafe(
	index int,
) []byte

func (*BytesCollection) GetAtSafePtr added in v0.9.8

func (it *BytesCollection) GetAtSafePtr(
	index int,
) *[]byte

func (*BytesCollection) GetAtSafeUsingLength added in v0.9.8

func (it *BytesCollection) GetAtSafeUsingLength(
	index, length int,
) *Result

func (*BytesCollection) GetPagedCollection added in v0.9.8

func (it *BytesCollection) GetPagedCollection(
	eachPageSize int,
) []*BytesCollection

func (*BytesCollection) GetPagesSize added in v0.9.8

func (it *BytesCollection) GetPagesSize(
	eachPageSize int,
) int

func (*BytesCollection) GetResultAtSafe added in v0.9.8

func (it *BytesCollection) GetResultAtSafe(
	index int,
) *Result

func (*BytesCollection) GetSinglePageCollection added in v0.9.8

func (it *BytesCollection) GetSinglePageCollection(
	eachPageSize int,
	pageIndex int,
) *BytesCollection

GetSinglePageCollection PageIndex is one based index. Should be above or equal 1

func (*BytesCollection) HasAnyItem added in v0.9.8

func (it *BytesCollection) HasAnyItem() bool

func (*BytesCollection) InjectIntoAt added in v0.9.8

func (it *BytesCollection) InjectIntoAt(
	index int,
	injector JsonParseSelfInjector,
) error

func (*BytesCollection) InjectIntoSameIndex added in v0.9.8

func (it *BytesCollection) InjectIntoSameIndex(
	injectors ...JsonParseSelfInjector,
) (
	errListPtr []error,
	hasAnyError bool,
)

InjectIntoSameIndex any nil skip

func (*BytesCollection) IsEmpty added in v0.9.8

func (it *BytesCollection) IsEmpty() bool

func (BytesCollection) Json added in v0.9.8

func (it BytesCollection) Json() Result

func (*BytesCollection) JsonModel added in v0.9.8

func (it *BytesCollection) JsonModel() *BytesCollection

func (*BytesCollection) JsonModelAny added in v0.9.8

func (it *BytesCollection) JsonModelAny() interface{}

func (*BytesCollection) JsonParseSelfInject added in v0.9.8

func (it *BytesCollection) JsonParseSelfInject(
	jsonResult *Result,
) error

func (BytesCollection) JsonPtr added in v0.9.8

func (it BytesCollection) JsonPtr() *Result

func (*BytesCollection) JsonResultAt added in v0.9.8

func (it *BytesCollection) JsonResultAt(
	index int,
) *Result

func (*BytesCollection) LastIndex added in v0.9.8

func (it *BytesCollection) LastIndex() int

func (*BytesCollection) LastOrDefault added in v0.9.8

func (it *BytesCollection) LastOrDefault() []byte

func (*BytesCollection) Length added in v0.9.8

func (it *BytesCollection) Length() int

func (*BytesCollection) Limit added in v0.9.8

func (it *BytesCollection) Limit(limit int) *BytesCollection

func (*BytesCollection) ParseInjectUsingJson added in v0.9.8

func (it *BytesCollection) ParseInjectUsingJson(
	jsonResult *Result,
) (*BytesCollection, error)

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

func (*BytesCollection) ParseInjectUsingJsonMust added in v0.9.8

func (it *BytesCollection) ParseInjectUsingJsonMust(
	jsonResult *Result,
) *BytesCollection

ParseInjectUsingJsonMust Panic if error

func (*BytesCollection) ShadowClone added in v0.9.8

func (it *BytesCollection) ShadowClone() BytesCollection

func (*BytesCollection) Skip added in v0.9.8

func (it *BytesCollection) Skip(skip int) *BytesCollection

func (*BytesCollection) Strings added in v0.9.8

func (it *BytesCollection) Strings() []string

func (*BytesCollection) StringsPtr added in v0.9.8

func (it *BytesCollection) StringsPtr() *[]string

func (*BytesCollection) Take added in v0.9.8

func (it *BytesCollection) Take(limit int) *BytesCollection

func (*BytesCollection) UnmarshalAt added in v0.9.8

func (it *BytesCollection) UnmarshalAt(
	index int,
	any interface{},
) error

func (*BytesCollection) UnmarshalIntoSameIndex added in v0.9.8

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

UnmarshalIntoSameIndex any nil skip

type JsonAnyModeler added in v0.9.5

type JsonAnyModeler interface {
	JsonModelAny() interface{}
}

type JsonContractsBinder added in v0.4.1

type JsonContractsBinder interface {
	SimpleJsoner
	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 JsonStringBinder added in v0.9.5

type JsonStringBinder interface {
	JsonStringer
	PrettyJsonStringer
	AsJsonStringBinder() JsonStringBinder
}

type JsonStringer added in v0.9.5

type JsonStringer interface {
	JsonString() string
}

type Jsoner

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

type KeyAny added in v0.8.3

type KeyAny struct {
	Key    string
	AnyInf interface{}
}

type KeyWithJsoner added in v0.8.3

type KeyWithJsoner struct {
	Key    string
	Jsoner Jsoner
}

type KeyWithResult added in v0.8.3

type KeyWithResult struct {
	Key    string
	Result Result
}

type MapResults added in v0.8.3

type MapResults struct {
	Items map[string]Result `json:"JsonResultsMap"`
}

func (*MapResults) Add added in v0.8.3

func (it *MapResults) Add(
	key string,
	result Result,
) *MapResults

func (*MapResults) AddAny added in v0.8.3

func (it *MapResults) AddAny(
	key string,
	item interface{},
) error

AddAny returns error if any during marshalling it.

func (*MapResults) AddAnyNonEmpty added in v0.8.3

func (it *MapResults) AddAnyNonEmpty(
	key string,
	item interface{},
) *MapResults

func (*MapResults) AddAnyNonEmptyNonError added in v0.8.3

func (it *MapResults) AddAnyNonEmptyNonError(
	key string,
	item interface{},
) *MapResults

func (*MapResults) AddAnySkipOnNil added in v0.8.3

func (it *MapResults) AddAnySkipOnNil(
	key string,
	item interface{},
) error

AddAnySkipOnNil returns error if any during marshalling it.

func (*MapResults) AddJsoner added in v0.8.3

func (it *MapResults) AddJsoner(
	key string,
	jsoner Jsoner,
) *MapResults

AddJsoner skip on nil

func (*MapResults) AddKeyAnyInf added in v0.8.3

func (it *MapResults) AddKeyAnyInf(
	result KeyAny,
) *MapResults

func (*MapResults) AddKeyAnyInfPtr added in v0.8.3

func (it *MapResults) AddKeyAnyInfPtr(
	result *KeyAny,
) *MapResults

func (*MapResults) AddKeyAnyItems added in v1.0.8

func (it *MapResults) AddKeyAnyItems(
	results ...KeyAny,
) *MapResults

func (*MapResults) AddKeyAnyItemsPtr added in v1.0.8

func (it *MapResults) AddKeyAnyItemsPtr(
	results ...*KeyAny,
) *MapResults

func (*MapResults) AddKeyWithJsoner added in v0.8.3

func (it *MapResults) AddKeyWithJsoner(
	keyWithJsoner KeyWithJsoner,
) *MapResults

func (*MapResults) AddKeyWithJsonerPtr added in v0.8.3

func (it *MapResults) AddKeyWithJsonerPtr(
	keyWithJsoner *KeyWithJsoner,
) *MapResults

func (*MapResults) AddKeyWithResult added in v0.8.3

func (it *MapResults) AddKeyWithResult(
	result KeyWithResult,
) *MapResults

func (*MapResults) AddKeyWithResultPtr added in v0.8.3

func (it *MapResults) AddKeyWithResultPtr(
	result *KeyWithResult,
) *MapResults

func (*MapResults) AddKeysWithJsoners added in v0.8.3

func (it *MapResults) AddKeysWithJsoners(
	keysWithJsoners ...KeyWithJsoner,
) *MapResults

func (*MapResults) AddKeysWithResults added in v0.8.3

func (it *MapResults) AddKeysWithResults(
	results ...KeyWithResult,
) *MapResults

func (*MapResults) AddKeysWithResultsPtr added in v0.8.3

func (it *MapResults) AddKeysWithResultsPtr(
	results ...*KeyWithResult,
) *MapResults

func (*MapResults) AddMapAnyItems added in v1.0.8

func (it *MapResults) AddMapAnyItems(
	addOrUpdateMap map[string]interface{},
) *MapResults

func (*MapResults) AddMapResults added in v0.8.3

func (it *MapResults) AddMapResults(
	mapResults *MapResults,
) *MapResults

func (*MapResults) AddMapResultsUsingCloneOption added in v0.8.5

func (it *MapResults) AddMapResultsUsingCloneOption(
	isClone, isDeepClone bool,
	mapResults map[string]Result,
) *MapResults

func (*MapResults) AddNonEmptyNonErrorPtr added in v0.8.3

func (it *MapResults) AddNonEmptyNonErrorPtr(
	key string,
	result *Result,
) *MapResults

func (*MapResults) AddPtr added in v0.8.3

func (it *MapResults) AddPtr(
	key string,
	result *Result,
) *MapResults

func (*MapResults) AddSkipOnNil added in v0.8.3

func (it *MapResults) AddSkipOnNil(
	key string,
	result *Result,
) *MapResults

AddSkipOnNil skip on nil

func (*MapResults) AllErrors added in v0.8.3

func (it *MapResults) AllErrors() (
	errListPtr []error,
	hasAnyError bool,
)

func (*MapResults) AllKeys added in v0.8.3

func (it *MapResults) AllKeys() []string

func (*MapResults) AllKeysSorted added in v0.8.5

func (it *MapResults) AllKeysSorted() []string

func (*MapResults) AllResults added in v0.8.3

func (it *MapResults) AllResults() []Result

func (*MapResults) AllResultsCollection added in v0.8.3

func (it *MapResults) AllResultsCollection() *ResultsCollection

func (*MapResults) AllValues added in v0.8.3

func (it *MapResults) AllValues() []Result

func (*MapResults) AsJsonContractsBinder added in v0.9.5

func (it *MapResults) AsJsonContractsBinder() JsonContractsBinder

func (*MapResults) AsJsonParseSelfInjector added in v0.8.3

func (it *MapResults) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*MapResults) AsJsoner added in v0.8.3

func (it *MapResults) AsJsoner() Jsoner

func (*MapResults) Clear added in v0.8.3

func (it *MapResults) Clear() *MapResults

func (*MapResults) Deserialize added in v1.1.0

func (it *MapResults) Deserialize(
	key string,
	any interface{},
) error

func (*MapResults) DeserializeMust added in v1.1.0

func (it *MapResults) DeserializeMust(
	key string,
	any interface{},
) *MapResults

func (*MapResults) Dispose added in v0.9.4

func (it *MapResults) Dispose()

func (*MapResults) GetByKey added in v1.0.8

func (it *MapResults) GetByKey(
	key string,
) *Result

func (*MapResults) GetErrorsAsSingle added in v0.8.3

func (it *MapResults) GetErrorsAsSingle() error

func (*MapResults) GetErrorsAsSingleString added in v0.8.3

func (it *MapResults) GetErrorsAsSingleString() string

func (*MapResults) GetErrorsStrings added in v0.8.3

func (it *MapResults) GetErrorsStrings() []string

func (*MapResults) GetErrorsStringsPtr added in v0.8.3

func (it *MapResults) GetErrorsStringsPtr() *[]string

func (*MapResults) GetNewMapUsingKeys added in v0.8.5

func (it *MapResults) GetNewMapUsingKeys(
	isPanicOnMissing bool,
	keys ...string,
) *MapResults

func (*MapResults) GetPagedCollection added in v0.8.5

func (it *MapResults) GetPagedCollection(
	eachPageSize int,
) []*MapResults

func (*MapResults) GetPagesSize added in v0.8.5

func (it *MapResults) GetPagesSize(
	eachPageSize int,
) int

func (*MapResults) GetSinglePageCollection added in v0.8.5

func (it *MapResults) GetSinglePageCollection(
	eachPageSize int,
	pageIndex int,
	allKeys []string,
) *MapResults

GetSinglePageCollection PageIndex is one based index. Should be above or equal 1

func (*MapResults) GetStrings added in v0.8.3

func (it *MapResults) GetStrings() []string

func (*MapResults) GetStringsPtr added in v0.8.3

func (it *MapResults) GetStringsPtr() *[]string

func (*MapResults) HasAnyItem added in v0.8.3

func (it *MapResults) HasAnyItem() bool

func (*MapResults) HasError added in v0.8.3

func (it *MapResults) HasError() bool

HasError has any error

func (*MapResults) InjectIntoAt added in v0.8.3

func (it *MapResults) InjectIntoAt(
	key string,
	injector JsonParseSelfInjector,
) error

func (*MapResults) IsEmpty added in v0.8.3

func (it *MapResults) IsEmpty() bool

func (MapResults) Json added in v0.8.3

func (it MapResults) Json() Result

func (*MapResults) JsonModel added in v0.8.3

func (it *MapResults) JsonModel() *MapResults

func (*MapResults) JsonModelAny added in v0.8.3

func (it *MapResults) JsonModelAny() interface{}

func (*MapResults) JsonParseSelfInject added in v0.8.3

func (it *MapResults) JsonParseSelfInject(
	jsonResult *Result,
) error

func (MapResults) JsonPtr added in v0.8.3

func (it MapResults) JsonPtr() *Result

func (*MapResults) LastIndex added in v0.8.3

func (it *MapResults) LastIndex() int

func (*MapResults) Length added in v0.8.3

func (it *MapResults) Length() int

func (*MapResults) ParseInjectUsingJson added in v0.8.3

func (it *MapResults) ParseInjectUsingJson(
	jsonResult *Result,
) (*MapResults, error)

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

func (*MapResults) ParseInjectUsingJsonMust added in v0.8.3

func (it *MapResults) ParseInjectUsingJsonMust(
	jsonResult *Result,
) *MapResults

ParseInjectUsingJsonMust Panic if error

func (*MapResults) ResultCollection added in v0.8.5

func (it *MapResults) ResultCollection() *ResultsCollection

func (*MapResults) SafeDeserialize added in v1.1.0

func (it *MapResults) SafeDeserialize(
	key string,
	any interface{},
) error

func (*MapResults) SafeDeserializeMust added in v1.1.0

func (it *MapResults) SafeDeserializeMust(
	key string,
	any interface{},
) *MapResults

func (*MapResults) SafeUnmarshal added in v1.1.0

func (it *MapResults) SafeUnmarshal(
	key string,
	any interface{},
) error

func (*MapResults) Unmarshal added in v1.1.0

func (it *MapResults) Unmarshal(
	key string,
	any interface{},
) error

func (*MapResults) UnmarshalMany added in v1.0.8

func (it *MapResults) UnmarshalMany(
	keyAnyItems ...KeyAny,
) error

func (*MapResults) UnmarshalManySafe added in v1.0.8

func (it *MapResults) UnmarshalManySafe(
	keyAnyItems ...KeyAny,
) error

type PrettyJsonStringer added in v0.9.5

type PrettyJsonStringer interface {
	PrettyJsonString() string
}

type Result

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

func New added in v0.1.7

func New(anyItem interface{}) Result

func NewPtr added in v0.1.7

func NewPtr(anyItem interface{}) *Result

func (*Result) AsJsonContractsBinder added in v0.9.5

func (it *Result) AsJsonContractsBinder() JsonContractsBinder

func (*Result) AsJsonParseSelfInjector added in v0.3.4

func (it *Result) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*Result) AsJsoner added in v0.3.4

func (it *Result) AsJsoner() Jsoner

func (*Result) BytesError added in v0.9.4

func (it *Result) BytesError() *coredata.BytesError

func (Result) Clone added in v0.8.3

func (it Result) Clone(isDeepClone bool) Result

func (*Result) CloneError added in v0.8.3

func (it *Result) CloneError() error

func (Result) CloneIf added in v0.8.5

func (it Result) CloneIf(isClone, isDeepClone bool) Result

func (*Result) ClonePtr added in v0.8.5

func (it *Result) ClonePtr(isDeepClone bool) *Result

func (*Result) CombineErrorWithRef added in v0.9.4

func (it *Result) CombineErrorWithRef(references ...string) string

func (*Result) CombineErrorWithRefError added in v0.9.4

func (it *Result) CombineErrorWithRefError(references ...string) error

func (*Result) Deserialize added in v1.0.8

func (it *Result) Deserialize(
	anyPointer interface{},
) error

Deserialize

Same as Unmarshal, just alias

func (*Result) DeserializeMust added in v1.0.8

func (it *Result) DeserializeMust(
	anyPointer interface{},
)

DeserializeMust

Same as UnmarshalMust, just alias

func (*Result) Dispose added in v0.9.4

func (it *Result) Dispose()

func (*Result) ErrorString added in v0.8.3

func (it *Result) ErrorString() string

func (*Result) HandleError

func (it *Result) HandleError()

func (*Result) HandleErrorWithMsg

func (it *Result) HandleErrorWithMsg(msg string)

func (*Result) HasBytes

func (it *Result) HasBytes() bool

HasBytes

Invert of Result.IsEmptyJsonBytes()

Represents has at least valid json data other than length 0 or "{}"

func (*Result) HasError

func (it *Result) HasError() bool

func (*Result) HasIssuesOrEmpty added in v0.7.7

func (it *Result) HasIssuesOrEmpty() bool

HasIssuesOrEmpty

Returns true
if Result is null
or has any error
or has empty json (length 0 or "{}")

Result.IsAnyNull() || Result.HasError() || Result.IsEmptyJsonBytes()

func (*Result) HasJson

func (it *Result) HasJson() bool

HasJson

Invert of Result.IsEmptyJsonBytes()

func (*Result) HasJsonBytes added in v1.1.0

func (it *Result) HasJsonBytes() bool

HasJsonBytes

Invert of Result.IsEmptyJsonBytes()

Represents has at least valid json data other than length 0 or "{}"

func (*Result) HasSafeItems added in v0.7.7

func (it *Result) HasSafeItems() bool

HasSafeItems

Returns true if
Result is not null
and has NO error
and has non-Empty json (other than length 0 or "{}")

Invert of HasIssuesOrEmpty

func (*Result) InjectInto added in v0.3.4

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

func (*Result) IsAnyNull added in v0.9.8

func (it *Result) IsAnyNull() bool

IsAnyNull

Returns true
if Result is null
or Bytes is null

func (*Result) IsEmpty added in v0.9.5

func (it *Result) IsEmpty() bool

func (*Result) IsEmptyError

func (it *Result) IsEmptyError() bool

func (*Result) IsEmptyJson

func (it *Result) IsEmptyJson() bool

func (*Result) IsEmptyJsonBytes

func (it *Result) IsEmptyJsonBytes() bool

IsEmptyJsonBytes

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

func (Result) IsEqual added in v0.8.3

func (it Result) IsEqual(another Result) bool

func (*Result) IsEqualPtr added in v0.9.1

func (it *Result) IsEqualPtr(another *Result) bool

func (*Result) IsErrorEqual added in v0.8.3

func (it *Result) IsErrorEqual(err error) bool

func (Result) Json added in v0.3.4

func (it Result) Json() Result

func (Result) JsonModel added in v0.3.4

func (it Result) JsonModel() Result

func (*Result) JsonModelAny added in v0.3.4

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

func (*Result) JsonParseSelfInject added in v0.3.4

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

func (Result) JsonPtr added in v0.8.3

func (it Result) JsonPtr() *Result

func (Result) JsonString

func (it Result) JsonString() string

func (*Result) JsonStringPtr

func (it *Result) JsonStringPtr() *string

func (*Result) Length added in v0.7.7

func (it *Result) Length() int

func (*Result) MeaningfulError added in v0.4.1

func (it *Result) MeaningfulError() error

MeaningfulError create error even if results are nil.

func (*Result) MeaningfulErrorMessage added in v1.1.0

func (it *Result) MeaningfulErrorMessage() string

func (*Result) MustBeSafe added in v1.1.0

func (it *Result) MustBeSafe()

MustBeSafe alias for HandleError

func (Result) NonPtr added in v0.8.5

func (it Result) NonPtr() Result

func (*Result) ParseInjectUsingJson added in v0.3.4

func (it *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 (it *Result) ParseInjectUsingJsonMust(
	jsonResultIn *Result,
) *Result

ParseInjectUsingJsonMust Panic if error

func (Result) PrettyJsonBuffer added in v0.9.5

func (it Result) PrettyJsonBuffer(prefix, indent string) (*bytes.Buffer, error)

func (Result) PrettyJsonString added in v0.9.5

func (it Result) PrettyJsonString() string

func (*Result) PrettyJsonStringWithErr added in v0.9.5

func (it *Result) PrettyJsonStringWithErr() string

func (*Result) Ptr added in v0.8.5

func (it *Result) Ptr() *Result

func (Result) Raw added in v1.0.8

func (it Result) Raw() ([]byte, error)

func (*Result) RawErrString added in v1.1.1

func (it *Result) RawErrString() (rawJsonBytes []byte, errorMsg string)

func (*Result) RawPrettyString added in v1.0.8

func (it *Result) RawPrettyString() (jsonString string, err error)

func (*Result) RawString added in v1.0.8

func (it *Result) RawString() (jsonString string, err error)

func (*Result) SafeBytes added in v0.9.8

func (it *Result) SafeBytes() []byte

func (*Result) SafeNonIssueBytes added in v0.9.8

func (it *Result) SafeNonIssueBytes() []byte

func (Result) SafeString added in v0.9.8

func (it Result) SafeString() string

func (*Result) SafeValues added in v0.9.8

func (it *Result) SafeValues() []byte

func (*Result) SafeValuesPtr added in v0.9.8

func (it *Result) SafeValuesPtr() *[]byte

func (*Result) Serialize added in v1.1.0

func (it *Result) Serialize() ([]byte, error)

func (*Result) SerializeMust added in v1.1.0

func (it *Result) SerializeMust() []byte

func (*Result) SerializeSkipExistingIssues added in v1.1.0

func (it *Result) SerializeSkipExistingIssues() (
	[]byte, error,
)

SerializeSkipExistingIssues

Ignores and returns nil if HasIssuesOrEmpty satisfied

func (*Result) String added in v0.7.7

func (it *Result) String() string

func (*Result) Unmarshal added in v0.3.1

func (it *Result) Unmarshal(
	anyPointer interface{},
) error

func (*Result) UnmarshalMust added in v1.0.8

func (it *Result) UnmarshalMust(
	anyPointer interface{},
)

func (*Result) UnmarshalResult added in v0.8.1

func (it *Result) UnmarshalResult() (*Result, error)

func (*Result) UnmarshalSkipExistingIssues added in v1.1.0

func (it *Result) UnmarshalSkipExistingIssues(
	anyItem interface{},
) error

UnmarshalSkipExistingIssues

Ignores and returns nil if HasIssuesOrEmpty satisfied

type ResultsCollection added in v0.3.4

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

func (*ResultsCollection) Add added in v0.3.4

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

func (*ResultsCollection) AddAny added in v0.8.5

func (it *ResultsCollection) AddAny(
	any interface{},
) *ResultsCollection

func (*ResultsCollection) AddAnyItems added in v1.0.8

func (it *ResultsCollection) AddAnyItems(
	anyItems ...interface{},
) *ResultsCollection

AddAnyItems Skip on nil

func (*ResultsCollection) AddAnyItemsSlice added in v1.0.8

func (it *ResultsCollection) AddAnyItemsSlice(
	anyItems []interface{},
) *ResultsCollection

AddAnyItemsSlice

Skip on nil

func (*ResultsCollection) AddJsoners added in v0.8.3

func (it *ResultsCollection) AddJsoners(
	isIgnoreNilOrError bool,
	jsoners ...Jsoner,
) *ResultsCollection

AddJsoners skip on nil

func (*ResultsCollection) AddMapResults added in v0.8.5

func (it *ResultsCollection) AddMapResults(
	mapResults *MapResults,
) *ResultsCollection

func (*ResultsCollection) AddNonNilItemsPtr added in v0.3.4

func (it *ResultsCollection) AddNonNilItemsPtr(
	results ...*Result,
) *ResultsCollection

AddNonNilItemsPtr skip on nil

func (*ResultsCollection) AddNonNilNonError added in v0.8.3

func (it *ResultsCollection) AddNonNilNonError(
	result *Result,
) *ResultsCollection

func (*ResultsCollection) AddPtr added in v0.8.3

func (it *ResultsCollection) AddPtr(
	result *Result,
) *ResultsCollection

func (*ResultsCollection) AddRawMapResults added in v0.8.5

func (it *ResultsCollection) AddRawMapResults(
	mapResults map[string]Result,
) *ResultsCollection

func (*ResultsCollection) AddResultsCollection added in v0.3.4

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

AddResultsCollection

skip on nil items

func (*ResultsCollection) AddSkipOnNil added in v0.3.5

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

AddSkipOnNil skip on nil

func (*ResultsCollection) Adds added in v0.3.4

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

func (*ResultsCollection) AddsPtr added in v0.8.3

func (it *ResultsCollection) AddsPtr(
	results ...*Result,
) *ResultsCollection

func (*ResultsCollection) AllErrors added in v0.3.4

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

func (*ResultsCollection) AsJsonContractsBinder added in v0.9.5

func (it *ResultsCollection) AsJsonContractsBinder() JsonContractsBinder

func (*ResultsCollection) AsJsonParseSelfInjector added in v0.3.4

func (it *ResultsCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*ResultsCollection) AsJsoner added in v0.3.4

func (it *ResultsCollection) AsJsoner() Jsoner

func (*ResultsCollection) Clear added in v0.3.4

func (it *ResultsCollection) Clear() *ResultsCollection

func (ResultsCollection) Clone added in v0.8.3

func (it ResultsCollection) Clone(isDeepCloneEach bool) ResultsCollection

func (*ResultsCollection) ClonePtr added in v0.8.7

func (it *ResultsCollection) ClonePtr(isDeepCloneEach bool) *ResultsCollection

func (*ResultsCollection) Dispose added in v0.9.4

func (it *ResultsCollection) Dispose()

func (*ResultsCollection) FirstOrDefault added in v0.7.7

func (it *ResultsCollection) FirstOrDefault() *Result

func (*ResultsCollection) GetAt added in v0.3.4

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

func (*ResultsCollection) GetAtSafe added in v0.3.4

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

func (*ResultsCollection) GetAtSafeUsingLength added in v0.3.4

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

func (*ResultsCollection) GetErrorsAsSingle added in v0.3.4

func (it *ResultsCollection) GetErrorsAsSingle() error

func (*ResultsCollection) GetErrorsAsSingleString added in v0.3.4

func (it *ResultsCollection) GetErrorsAsSingleString() string

func (*ResultsCollection) GetErrorsStrings added in v0.3.5

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

func (*ResultsCollection) GetErrorsStringsPtr added in v0.8.3

func (it *ResultsCollection) GetErrorsStringsPtr() *[]string

func (*ResultsCollection) GetPagedCollection added in v0.8.5

func (it *ResultsCollection) GetPagedCollection(
	eachPageSize int,
) []*ResultsCollection

func (*ResultsCollection) GetPagesSize added in v0.8.5

func (it *ResultsCollection) GetPagesSize(
	eachPageSize int,
) int

func (*ResultsCollection) GetSinglePageCollection added in v0.8.5

func (it *ResultsCollection) GetSinglePageCollection(
	eachPageSize int,
	pageIndex int,
) *ResultsCollection

GetSinglePageCollection PageIndex is one based index. Should be above or equal 1

func (*ResultsCollection) GetStrings added in v0.3.4

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

func (*ResultsCollection) GetStringsPtr added in v0.8.3

func (it *ResultsCollection) GetStringsPtr() *[]string

func (*ResultsCollection) HasAnyItem added in v0.7.7

func (it *ResultsCollection) HasAnyItem() bool

func (*ResultsCollection) HasError added in v0.3.4

func (it *ResultsCollection) HasError() bool

HasError has any error

func (*ResultsCollection) InjectIntoAt added in v0.3.4

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

func (*ResultsCollection) InjectIntoSameIndex added in v0.3.4

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

InjectIntoSameIndex any nil skip

func (*ResultsCollection) IsEmpty added in v0.3.4

func (it *ResultsCollection) IsEmpty() bool

func (ResultsCollection) Json added in v0.3.4

func (it ResultsCollection) Json() Result

func (*ResultsCollection) JsonModel added in v0.3.4

func (it *ResultsCollection) JsonModel() *ResultsCollection

func (*ResultsCollection) JsonModelAny added in v0.3.4

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

func (*ResultsCollection) JsonParseSelfInject added in v0.3.4

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

func (ResultsCollection) JsonPtr added in v0.8.3

func (it ResultsCollection) JsonPtr() *Result

func (*ResultsCollection) LastIndex added in v0.7.7

func (it *ResultsCollection) LastIndex() int

func (*ResultsCollection) LastOrDefault added in v0.7.7

func (it *ResultsCollection) LastOrDefault() *Result

func (*ResultsCollection) Length added in v0.3.4

func (it *ResultsCollection) Length() int

func (*ResultsCollection) Limit added in v0.7.7

func (it *ResultsCollection) Limit(limit int) *ResultsCollection

func (ResultsCollection) NonPtr added in v1.0.0

func (*ResultsCollection) ParseInjectUsingJson added in v0.3.4

func (it *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 (it *ResultsCollection) ParseInjectUsingJsonMust(
	jsonResult *Result,
) *ResultsCollection

ParseInjectUsingJsonMust Panic if error

func (*ResultsCollection) Ptr added in v1.0.0

func (ResultsCollection) ShadowClone added in v0.8.3

func (it ResultsCollection) ShadowClone() ResultsCollection

func (*ResultsCollection) Skip added in v0.7.7

func (it *ResultsCollection) Skip(skip int) *ResultsCollection

func (*ResultsCollection) Take added in v0.7.7

func (it *ResultsCollection) Take(limit int) *ResultsCollection

func (*ResultsCollection) UnmarshalAt added in v0.3.4

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

func (*ResultsCollection) UnmarshalIntoSameIndex added in v0.3.4

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

UnmarshalIntoSameIndex any nil skip

type ResultsPtrCollection added in v0.8.3

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

func (*ResultsPtrCollection) Add added in v0.8.3

func (it *ResultsPtrCollection) Add(
	result *Result,
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddAny added in v0.8.5

func (it *ResultsPtrCollection) AddAny(
	any interface{},
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddAnyItems added in v1.0.8

func (it *ResultsPtrCollection) AddAnyItems(
	anys ...interface{},
) *ResultsPtrCollection

AddAnyItems Skip on nil

func (*ResultsPtrCollection) AddJsoners added in v0.8.3

func (it *ResultsPtrCollection) AddJsoners(
	isIgnoreNilOrError bool,
	jsoners ...Jsoner,
) *ResultsPtrCollection

AddJsoners skip on nil

func (*ResultsPtrCollection) AddNonNilItems added in v0.8.3

func (it *ResultsPtrCollection) AddNonNilItems(
	results ...*Result,
) *ResultsPtrCollection

AddNonNilItems skip on nil

func (*ResultsPtrCollection) AddNonNilItemsPtr added in v0.8.3

func (it *ResultsPtrCollection) AddNonNilItemsPtr(
	results ...*Result,
) *ResultsPtrCollection

AddNonNilItemsPtr skip on nil

func (*ResultsPtrCollection) AddNonNilNonError added in v0.8.3

func (it *ResultsPtrCollection) AddNonNilNonError(
	result *Result,
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddResult added in v0.8.3

func (it *ResultsPtrCollection) AddResult(
	result Result,
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddResultsCollection added in v0.8.3

func (it *ResultsPtrCollection) AddResultsCollection(
	collection *ResultsPtrCollection,
) *ResultsPtrCollection

AddResultsCollection skip on nil items

func (*ResultsPtrCollection) AddSkipOnNil added in v0.8.3

func (it *ResultsPtrCollection) AddSkipOnNil(
	result *Result,
) *ResultsPtrCollection

AddSkipOnNil skip on nil

func (*ResultsPtrCollection) Adds added in v0.8.3

func (it *ResultsPtrCollection) Adds(
	results ...*Result,
) *ResultsPtrCollection

func (*ResultsPtrCollection) AllErrors added in v0.8.3

func (it *ResultsPtrCollection) AllErrors() (
	errListPtr []error,
	hasAnyError bool,
)

func (*ResultsPtrCollection) AsJsonContractsBinder added in v0.9.5

func (it *ResultsPtrCollection) AsJsonContractsBinder() JsonContractsBinder

func (*ResultsPtrCollection) AsJsonParseSelfInjector added in v0.8.3

func (it *ResultsPtrCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*ResultsPtrCollection) AsJsoner added in v0.8.3

func (it *ResultsPtrCollection) AsJsoner() Jsoner

func (*ResultsPtrCollection) Clear added in v0.8.3

func (*ResultsPtrCollection) Clone added in v0.8.3

func (it *ResultsPtrCollection) Clone(
	isDeepCloneEach bool,
) *ResultsPtrCollection

func (*ResultsPtrCollection) Dispose added in v0.9.4

func (it *ResultsPtrCollection) Dispose()

func (*ResultsPtrCollection) FirstOrDefault added in v0.8.3

func (it *ResultsPtrCollection) FirstOrDefault() *Result

func (*ResultsPtrCollection) GetAt added in v0.8.3

func (it *ResultsPtrCollection) GetAt(
	index int,
) *Result

func (*ResultsPtrCollection) GetAtSafe added in v0.8.3

func (it *ResultsPtrCollection) GetAtSafe(
	index int,
) *Result

func (*ResultsPtrCollection) GetAtSafeUsingLength added in v0.8.3

func (it *ResultsPtrCollection) GetAtSafeUsingLength(
	index, length int,
) *Result

func (*ResultsPtrCollection) GetErrorsAsSingle added in v0.8.3

func (it *ResultsPtrCollection) GetErrorsAsSingle() error

func (*ResultsPtrCollection) GetErrorsAsSingleString added in v0.8.3

func (it *ResultsPtrCollection) GetErrorsAsSingleString() string

func (*ResultsPtrCollection) GetErrorsStrings added in v0.8.3

func (it *ResultsPtrCollection) GetErrorsStrings() []string

func (*ResultsPtrCollection) GetErrorsStringsPtr added in v0.8.3

func (it *ResultsPtrCollection) GetErrorsStringsPtr() *[]string

func (*ResultsPtrCollection) GetPagedCollection added in v0.8.5

func (it *ResultsPtrCollection) GetPagedCollection(
	eachPageSize int,
) []*ResultsPtrCollection

func (*ResultsPtrCollection) GetPagesSize added in v0.8.5

func (it *ResultsPtrCollection) GetPagesSize(
	eachPageSize int,
) int

func (*ResultsPtrCollection) GetSinglePageCollection added in v0.8.5

func (it *ResultsPtrCollection) GetSinglePageCollection(
	eachPageSize int,
	pageIndex int,
) *ResultsPtrCollection

GetSinglePageCollection PageIndex is one based index. Should be above or equal 1

func (*ResultsPtrCollection) GetStrings added in v0.8.3

func (it *ResultsPtrCollection) GetStrings() []string

func (*ResultsPtrCollection) GetStringsPtr added in v0.8.3

func (it *ResultsPtrCollection) GetStringsPtr() *[]string

func (*ResultsPtrCollection) HasAnyItem added in v0.8.3

func (it *ResultsPtrCollection) HasAnyItem() bool

func (*ResultsPtrCollection) HasError added in v0.8.3

func (it *ResultsPtrCollection) HasError() bool

HasError has any error

func (*ResultsPtrCollection) InjectIntoAt added in v0.8.3

func (it *ResultsPtrCollection) InjectIntoAt(
	index int,
	injector JsonParseSelfInjector,
) error

func (*ResultsPtrCollection) InjectIntoSameIndex added in v0.8.3

func (it *ResultsPtrCollection) InjectIntoSameIndex(
	injectors ...JsonParseSelfInjector,
) (
	errListPtr []error,
	hasAnyError bool,
)

InjectIntoSameIndex any nil skip

func (*ResultsPtrCollection) IsEmpty added in v0.8.3

func (it *ResultsPtrCollection) IsEmpty() bool

func (ResultsPtrCollection) Json added in v0.8.3

func (it ResultsPtrCollection) Json() Result

func (*ResultsPtrCollection) JsonModel added in v0.8.3

func (it *ResultsPtrCollection) JsonModel() *ResultsPtrCollection

func (*ResultsPtrCollection) JsonModelAny added in v0.8.3

func (it *ResultsPtrCollection) JsonModelAny() interface{}

func (*ResultsPtrCollection) JsonParseSelfInject added in v0.8.3

func (it *ResultsPtrCollection) JsonParseSelfInject(
	jsonResult *Result,
) error

func (ResultsPtrCollection) JsonPtr added in v0.8.3

func (it ResultsPtrCollection) JsonPtr() *Result

func (*ResultsPtrCollection) LastIndex added in v0.8.3

func (it *ResultsPtrCollection) LastIndex() int

func (*ResultsPtrCollection) LastOrDefault added in v0.8.3

func (it *ResultsPtrCollection) LastOrDefault() *Result

func (*ResultsPtrCollection) Length added in v0.8.3

func (it *ResultsPtrCollection) Length() int

func (*ResultsPtrCollection) Limit added in v0.8.3

func (it *ResultsPtrCollection) Limit(limit int) *ResultsPtrCollection

func (ResultsPtrCollection) NonPtr added in v1.0.0

func (*ResultsPtrCollection) ParseInjectUsingJson added in v0.8.3

func (it *ResultsPtrCollection) ParseInjectUsingJson(
	jsonResult *Result,
) (*ResultsPtrCollection, error)

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

func (*ResultsPtrCollection) ParseInjectUsingJsonMust added in v0.8.3

func (it *ResultsPtrCollection) ParseInjectUsingJsonMust(
	jsonResult *Result,
) *ResultsPtrCollection

ParseInjectUsingJsonMust Panic if error

func (*ResultsPtrCollection) Ptr added in v1.0.0

func (*ResultsPtrCollection) Skip added in v0.8.3

func (*ResultsPtrCollection) Take added in v0.8.3

func (*ResultsPtrCollection) UnmarshalAt added in v0.8.3

func (it *ResultsPtrCollection) UnmarshalAt(
	index int,
	any interface{},
) error

func (*ResultsPtrCollection) UnmarshalIntoSameIndex added in v0.8.3

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

UnmarshalIntoSameIndex any nil skip

type SimpleJsonBinder added in v0.9.5

type SimpleJsonBinder interface {
	Jsoner
	AsSimpleJsonBinder() SimpleJsonBinder
}

type SimpleJsoner added in v0.9.5

type SimpleJsoner interface {
	Jsoner
	JsonParseSelfInjector
}

Jump to

Keyboard shortcuts

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