corejson

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 17 Imported by: 95

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{}
	CastAny                 = castingAny{}
	AnyTo                   = anyTo{}
	StaticJsonError         = errcore.
							EmptyResultCannotMakeJsonType.
							ErrorNoRefs(constants.EmptyString)
)

Functions

func BytesCloneIf

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

func BytesDeepClone

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

func BytesToPrettyString

func BytesToPrettyString(
	jsonBytes []byte,
) string

func BytesToString

func BytesToString(
	jsonBytes []byte,
) string

func JsonString

func JsonString(anyItem interface{}) (jsonString string, err error)

func JsonStringOrErrMsg

func JsonStringOrErrMsg(anyItem interface{}) (jsonStringOrErr string)

Types

type BytesCollection

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

BytesCollection

Only collects json byes nothing else.
errors will be ignored or returned during add.

func (*BytesCollection) Add

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

func (*BytesCollection) AddAny

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

func (*BytesCollection) AddAnyItems

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

func (*BytesCollection) AddBytesCollection

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

AddBytesCollection skip on nil items

func (*BytesCollection) AddJsoners

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

AddJsoners skip on nil

func (*BytesCollection) AddMapResults

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

func (*BytesCollection) AddNonEmpty

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

AddNonEmpty

skip on empty

func (*BytesCollection) AddPtr

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

func (*BytesCollection) AddRawMapResults

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

func (*BytesCollection) AddResult

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

AddResult

skip on empty or has issue

func (*BytesCollection) AddResultPtr

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

AddResultPtr

skip on empty or has issue

func (*BytesCollection) AddSerializer

func (it *BytesCollection) AddSerializer(
	serializer bytesSerializer,
) *BytesCollection

func (*BytesCollection) AddSerializerFunc

func (it *BytesCollection) AddSerializerFunc(
	serializerFunc func() ([]byte, error),
) *BytesCollection

func (*BytesCollection) AddSerializerFunctions

func (it *BytesCollection) AddSerializerFunctions(
	serializerFunctions ...func() ([]byte, error),
) *BytesCollection

func (*BytesCollection) AddSerializers

func (it *BytesCollection) AddSerializers(
	serializers ...bytesSerializer,
) *BytesCollection

func (*BytesCollection) AddSkipOnNil

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

AddSkipOnNil skip on nil

func (*BytesCollection) Adds

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

func (*BytesCollection) AddsPtr

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

func (*BytesCollection) AsJsonContractsBinder

func (it *BytesCollection) AsJsonContractsBinder() JsonContractsBinder

func (*BytesCollection) AsJsonParseSelfInjector

func (it *BytesCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*BytesCollection) AsJsoner

func (it *BytesCollection) AsJsoner() Jsoner

func (*BytesCollection) Clear

func (it *BytesCollection) Clear() *BytesCollection

func (BytesCollection) Clone

func (it BytesCollection) Clone(isDeepCloneEach bool) BytesCollection

func (*BytesCollection) ClonePtr

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

func (*BytesCollection) Dispose

func (it *BytesCollection) Dispose()

func (*BytesCollection) FirstOrDefault

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

func (*BytesCollection) GetAt

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

func (*BytesCollection) GetAtSafe

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

func (*BytesCollection) GetAtSafePtr

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

func (*BytesCollection) GetAtSafeUsingLength

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

func (*BytesCollection) GetPagedCollection

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

func (*BytesCollection) GetPagesSize

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

func (*BytesCollection) GetResultAtSafe

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

func (*BytesCollection) GetSinglePageCollection

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

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

func (*BytesCollection) HasAnyItem

func (it *BytesCollection) HasAnyItem() bool

func (*BytesCollection) InjectIntoAt

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

func (*BytesCollection) InjectIntoSameIndex

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

InjectIntoSameIndex any nil skip

func (*BytesCollection) IsEmpty

func (it *BytesCollection) IsEmpty() bool

func (BytesCollection) Json

func (it BytesCollection) Json() Result

func (*BytesCollection) JsonModel

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

func (*BytesCollection) JsonModelAny

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

func (*BytesCollection) JsonParseSelfInject

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

func (BytesCollection) JsonPtr

func (it BytesCollection) JsonPtr() *Result

func (*BytesCollection) JsonResultAt

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

func (*BytesCollection) LastIndex

func (it *BytesCollection) LastIndex() int

func (*BytesCollection) LastOrDefault

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

func (*BytesCollection) Length

func (it *BytesCollection) Length() int

func (*BytesCollection) Limit

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

func (BytesCollection) MarshalJSON

func (it BytesCollection) MarshalJSON() ([]byte, error)

func (*BytesCollection) ParseInjectUsingJson

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

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

func (*BytesCollection) ParseInjectUsingJsonMust

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

ParseInjectUsingJsonMust Panic if error

func (*BytesCollection) ShadowClone

func (it *BytesCollection) ShadowClone() BytesCollection

func (*BytesCollection) Skip

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

func (*BytesCollection) Strings

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

func (*BytesCollection) StringsPtr

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

func (*BytesCollection) Take

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

func (*BytesCollection) UnmarshalAt

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

func (*BytesCollection) UnmarshalIntoSameIndex

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

UnmarshalIntoSameIndex any nil skip

func (BytesCollection) UnmarshalJSON

func (it BytesCollection) UnmarshalJSON(
	rawJsonBytes []byte,
) error

type JsonAnyModeler

type JsonAnyModeler interface {
	JsonModelAny() interface{}
}

type JsonContractsBinder

type JsonContractsBinder interface {
	SimpleJsoner
	AsJsonContractsBinder() JsonContractsBinder
}

type JsonMarshaller

type JsonMarshaller interface {
	// MarshalJSON
	//
	//  alias for Serialize (from any to json)
	MarshalJSON() (jsonBytes []byte, parsedErr error)
	// UnmarshalJSON
	//
	//  alias for Deserialize (from json to any)
	UnmarshalJSON(rawJsonBytes []byte) error
}

type JsonParseSelfInjector

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

type JsonStringBinder

type JsonStringBinder interface {
	JsonStringer
	PrettyJsonStringer
	AsJsonStringBinder() JsonStringBinder
}

type JsonStringer

type JsonStringer interface {
	JsonString() string
}

type Jsoner

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

type KeyAny

type KeyAny struct {
	Key    string
	AnyInf interface{}
}

type KeyWithJsoner

type KeyWithJsoner struct {
	Key    string
	Jsoner Jsoner
}

type KeyWithResult

type KeyWithResult struct {
	Key    string
	Result Result
}

type MapResults

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

func (*MapResults) Add

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

func (*MapResults) AddAny

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

AddAny returns error if any during marshalling it.

func (*MapResults) AddAnyNonEmpty

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

func (*MapResults) AddAnyNonEmptyNonError

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

func (*MapResults) AddAnySkipOnNil

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

AddAnySkipOnNil returns error if any during marshalling it.

func (*MapResults) AddJsoner

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

AddJsoner skip on nil

func (*MapResults) AddKeyAnyInf

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

func (*MapResults) AddKeyAnyInfPtr

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

func (*MapResults) AddKeyAnyItems

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

func (*MapResults) AddKeyAnyItemsPtr

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

func (*MapResults) AddKeyWithJsoner

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

func (*MapResults) AddKeyWithJsonerPtr

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

func (*MapResults) AddKeyWithResult

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

func (*MapResults) AddKeyWithResultPtr

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

func (*MapResults) AddKeysWithJsoners

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

func (*MapResults) AddKeysWithResults

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

func (*MapResults) AddKeysWithResultsPtr

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

func (*MapResults) AddMapAnyItems

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

func (*MapResults) AddMapResults

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

func (*MapResults) AddMapResultsUsingCloneOption

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

func (*MapResults) AddNonEmptyNonErrorPtr

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

func (*MapResults) AddPtr

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

func (*MapResults) AddSkipOnNil

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

AddSkipOnNil skip on nil

func (*MapResults) AllErrors

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

func (*MapResults) AllKeys

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

func (*MapResults) AllKeysSorted

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

func (*MapResults) AllResults

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

func (*MapResults) AllResultsCollection

func (it *MapResults) AllResultsCollection() *ResultsCollection

func (*MapResults) AllValues

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

func (*MapResults) AsJsonContractsBinder

func (it *MapResults) AsJsonContractsBinder() JsonContractsBinder

func (*MapResults) AsJsonParseSelfInjector

func (it *MapResults) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*MapResults) AsJsoner

func (it *MapResults) AsJsoner() Jsoner

func (*MapResults) Clear

func (it *MapResults) Clear() *MapResults

func (*MapResults) Deserialize

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

func (*MapResults) DeserializeMust

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

func (*MapResults) Dispose

func (it *MapResults) Dispose()

func (*MapResults) GetByKey

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

func (*MapResults) GetErrorsAsSingle

func (it *MapResults) GetErrorsAsSingle() error

func (*MapResults) GetErrorsAsSingleString

func (it *MapResults) GetErrorsAsSingleString() string

func (*MapResults) GetErrorsStrings

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

func (*MapResults) GetErrorsStringsPtr

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

func (*MapResults) GetNewMapUsingKeys

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

func (*MapResults) GetPagedCollection

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

func (*MapResults) GetPagesSize

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

func (*MapResults) GetSinglePageCollection

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

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

func (*MapResults) GetStringsPtr

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

func (*MapResults) HasAnyItem

func (it *MapResults) HasAnyItem() bool

func (*MapResults) HasError

func (it *MapResults) HasError() bool

HasError has any error

func (*MapResults) InjectIntoAt

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

func (*MapResults) IsEmpty

func (it *MapResults) IsEmpty() bool

func (MapResults) Json

func (it MapResults) Json() Result

func (*MapResults) JsonModel

func (it *MapResults) JsonModel() *MapResults

func (*MapResults) JsonModelAny

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

func (*MapResults) JsonParseSelfInject

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

func (MapResults) JsonPtr

func (it MapResults) JsonPtr() *Result

func (*MapResults) LastIndex

func (it *MapResults) LastIndex() int

func (*MapResults) Length

func (it *MapResults) Length() int

func (*MapResults) ParseInjectUsingJson

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

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

func (*MapResults) ParseInjectUsingJsonMust

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

ParseInjectUsingJsonMust Panic if error

func (*MapResults) ResultCollection

func (it *MapResults) ResultCollection() *ResultsCollection

func (*MapResults) SafeDeserialize

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

func (*MapResults) SafeDeserializeMust

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

func (*MapResults) SafeUnmarshal

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

func (*MapResults) Unmarshal

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

func (*MapResults) UnmarshalMany

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

func (*MapResults) UnmarshalManySafe

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

type PrettyJsonStringer

type PrettyJsonStringer interface {
	PrettyJsonString() string
}

type Result

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

func New

func New(anyItem interface{}) Result

func NewPtr

func NewPtr(anyItem interface{}) *Result

func (Result) AsJsonContractsBinder

func (it Result) AsJsonContractsBinder() JsonContractsBinder

func (Result) AsJsonParseSelfInjector

func (it Result) AsJsonParseSelfInjector() JsonParseSelfInjector

func (Result) AsJsoner

func (it Result) AsJsoner() Jsoner

func (*Result) BytesError

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

func (*Result) BytesTypeName

func (it *Result) BytesTypeName() string

func (Result) Clone

func (it Result) Clone(isDeepClone bool) Result

func (*Result) CloneError

func (it *Result) CloneError() error

func (Result) CloneIf

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

func (*Result) ClonePtr

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

func (*Result) CombineErrorWithRefError

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

func (*Result) CombineErrorWithRefString

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

func (*Result) Deserialize

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

Deserialize

Same as Unmarshal, just alias

func (*Result) DeserializeMust

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

DeserializeMust

Same as UnmarshalMust, just alias

func (*Result) DeserializedFieldsToMap

func (it *Result) DeserializedFieldsToMap() (
	fieldsMap map[string]interface{},
	parsingErr error,
)

func (*Result) Dispose

func (it *Result) Dispose()

func (*Result) ErrorString

func (it *Result) ErrorString() string

func (*Result) FieldsNames

func (it *Result) FieldsNames() (
	fieldsNames []string,
	parsingErr error,
)

func (*Result) HandleError

func (it *Result) HandleError()

func (*Result) HandleErrorWithMsg

func (it *Result) HandleErrorWithMsg(msg string)

func (Result) HasAnyItem

func (it Result) HasAnyItem() bool

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

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

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

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

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

func (*Result) IsAnyNull

func (it *Result) IsAnyNull() bool

IsAnyNull

Returns true
if Result is null
or Bytes is null

func (*Result) IsEmpty

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

func (it Result) IsEqual(another Result) bool

func (*Result) IsEqualPtr

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

func (*Result) IsErrorEqual

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

func (Result) Json

func (it Result) Json() Result

Json

creates json result of self

func (*Result) JsonModel

func (it *Result) JsonModel() Result

func (*Result) JsonModelAny

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

func (Result) JsonParseSelfInject

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

func (Result) JsonPtr

func (it Result) JsonPtr() *Result

JsonPtr

creates json result of self

func (*Result) JsonString

func (it *Result) JsonString() string

func (*Result) JsonStringPtr

func (it *Result) JsonStringPtr() *string

func (*Result) Length

func (it *Result) Length() int

func (*Result) Map

func (it *Result) Map() map[string]string

func (*Result) MeaningfulError

func (it *Result) MeaningfulError() error

MeaningfulError

create error even if results are nil.

func (*Result) MeaningfulErrorMessage

func (it *Result) MeaningfulErrorMessage() string

func (*Result) MustBeSafe

func (it *Result) MustBeSafe()

MustBeSafe alias for HandleError

func (*Result) NonPtr

func (it *Result) NonPtr() Result

func (*Result) ParseInjectUsingJson

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

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

func (*Result) ParseInjectUsingJsonMust

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

ParseInjectUsingJsonMust Panic if error

func (*Result) PrettyJsonBuffer

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

func (*Result) PrettyJsonString

func (it *Result) PrettyJsonString() string

func (*Result) PrettyJsonStringOrErrString

func (it *Result) PrettyJsonStringOrErrString() string

func (Result) Ptr

func (it Result) Ptr() *Result

func (*Result) Raw

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

func (*Result) RawErrString

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

func (*Result) RawMust

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

func (*Result) RawPrettyString

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

func (*Result) RawString

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

func (*Result) RawStringMust

func (it *Result) RawStringMust() (jsonString string)

func (*Result) SafeBytes

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

func (*Result) SafeBytesTypeName

func (it *Result) SafeBytesTypeName() string

func (*Result) SafeDeserializedFieldsToMap

func (it *Result) SafeDeserializedFieldsToMap() (
	fieldsMap map[string]interface{},
)

SafeDeserializedFieldsToMap

Warning:

  • Swallows the error

func (*Result) SafeFieldsNames

func (it *Result) SafeFieldsNames() (
	fieldsNames []string,
)

SafeFieldsNames

Warning:

  • Swallows the error

func (*Result) SafeNonIssueBytes

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

func (*Result) SafeString

func (it *Result) SafeString() string

func (*Result) SafeValues

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

func (*Result) SafeValuesPtr

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

func (*Result) Serialize

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

func (*Result) SerializeMust

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

func (*Result) SerializeSkipExistingIssues

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

SerializeSkipExistingIssues

Ignores and returns nil if HasIssuesOrEmpty satisfied

func (Result) String

func (it Result) String() string

func (Result) ToNonPtr

func (it Result) ToNonPtr() Result

func (Result) ToPtr

func (it Result) ToPtr() *Result

func (*Result) Unmarshal

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

Unmarshal

deserializes current safe bytes to given pointer

func (*Result) UnmarshalMust

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

func (*Result) UnmarshalResult

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

func (*Result) UnmarshalSkipExistingIssues

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

UnmarshalSkipExistingIssues

Ignores and returns nil if HasIssuesOrEmpty satisfied

func (*Result) Values

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

type ResultsCollection

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

func (*ResultsCollection) Add

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

func (*ResultsCollection) AddAny

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

func (*ResultsCollection) AddAnyItems

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

AddAnyItems Skip on nil

func (*ResultsCollection) AddAnyItemsSlice

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

AddAnyItemsSlice

Skip on nil

func (*ResultsCollection) AddJsoners

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

AddJsoners skip on nil

func (*ResultsCollection) AddMapResults

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

func (*ResultsCollection) AddNonNilItemsPtr

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

AddNonNilItemsPtr skip on nil

func (*ResultsCollection) AddNonNilNonError

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

func (*ResultsCollection) AddPtr

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

func (*ResultsCollection) AddRawMapResults

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

func (*ResultsCollection) AddResultsCollection

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

AddResultsCollection

skip on nil items

func (*ResultsCollection) AddSerializer

func (it *ResultsCollection) AddSerializer(
	serializer bytesSerializer,
) *ResultsCollection

func (*ResultsCollection) AddSerializerFunc

func (it *ResultsCollection) AddSerializerFunc(
	serializerFunc func() ([]byte, error),
) *ResultsCollection

func (*ResultsCollection) AddSerializerFunctions

func (it *ResultsCollection) AddSerializerFunctions(
	serializerFunctions ...func() ([]byte, error),
) *ResultsCollection

func (*ResultsCollection) AddSerializers

func (it *ResultsCollection) AddSerializers(
	serializers ...bytesSerializer,
) *ResultsCollection

func (*ResultsCollection) AddSkipOnNil

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

AddSkipOnNil skip on nil

func (*ResultsCollection) Adds

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

func (*ResultsCollection) AddsPtr

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

func (*ResultsCollection) AllErrors

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

func (*ResultsCollection) AsJsonContractsBinder

func (it *ResultsCollection) AsJsonContractsBinder() JsonContractsBinder

func (*ResultsCollection) AsJsonParseSelfInjector

func (it *ResultsCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*ResultsCollection) AsJsoner

func (it *ResultsCollection) AsJsoner() Jsoner

func (*ResultsCollection) Clear

func (it *ResultsCollection) Clear() *ResultsCollection

func (ResultsCollection) Clone

func (it ResultsCollection) Clone(isDeepCloneEach bool) ResultsCollection

func (*ResultsCollection) ClonePtr

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

func (*ResultsCollection) Dispose

func (it *ResultsCollection) Dispose()

func (*ResultsCollection) FirstOrDefault

func (it *ResultsCollection) FirstOrDefault() *Result

func (*ResultsCollection) GetAt

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

func (*ResultsCollection) GetAtSafe

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

func (*ResultsCollection) GetAtSafeUsingLength

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

func (*ResultsCollection) GetErrorsAsSingle

func (it *ResultsCollection) GetErrorsAsSingle() error

func (*ResultsCollection) GetErrorsAsSingleString

func (it *ResultsCollection) GetErrorsAsSingleString() string

func (*ResultsCollection) GetErrorsStrings

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

func (*ResultsCollection) GetErrorsStringsPtr

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

func (*ResultsCollection) GetPagedCollection

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

func (*ResultsCollection) GetPagesSize

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

func (*ResultsCollection) GetSinglePageCollection

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

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

func (*ResultsCollection) GetStrings

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

func (*ResultsCollection) GetStringsPtr

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

func (*ResultsCollection) HasAnyItem

func (it *ResultsCollection) HasAnyItem() bool

func (*ResultsCollection) HasError

func (it *ResultsCollection) HasError() bool

HasError has any error

func (*ResultsCollection) InjectIntoAt

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

func (*ResultsCollection) InjectIntoSameIndex

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

InjectIntoSameIndex any nil skip

func (*ResultsCollection) IsEmpty

func (it *ResultsCollection) IsEmpty() bool

func (ResultsCollection) Json

func (it ResultsCollection) Json() Result

func (*ResultsCollection) JsonModel

func (it *ResultsCollection) JsonModel() *ResultsCollection

func (*ResultsCollection) JsonModelAny

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

func (*ResultsCollection) JsonParseSelfInject

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

func (ResultsCollection) JsonPtr

func (it ResultsCollection) JsonPtr() *Result

func (*ResultsCollection) LastIndex

func (it *ResultsCollection) LastIndex() int

func (*ResultsCollection) LastOrDefault

func (it *ResultsCollection) LastOrDefault() *Result

func (*ResultsCollection) Length

func (it *ResultsCollection) Length() int

func (*ResultsCollection) Limit

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

func (ResultsCollection) NonPtr

func (*ResultsCollection) ParseInjectUsingJson

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

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

func (*ResultsCollection) ParseInjectUsingJsonMust

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

ParseInjectUsingJsonMust Panic if error

func (*ResultsCollection) Ptr

func (ResultsCollection) ShadowClone

func (it ResultsCollection) ShadowClone() ResultsCollection

func (*ResultsCollection) Skip

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

func (*ResultsCollection) Take

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

func (*ResultsCollection) UnmarshalAt

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

func (*ResultsCollection) UnmarshalIntoSameIndex

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

UnmarshalIntoSameIndex any nil skip

type ResultsPtrCollection

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

func (*ResultsPtrCollection) Add

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

func (*ResultsPtrCollection) AddAny

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

func (*ResultsPtrCollection) AddAnyItems

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

AddAnyItems Skip on nil

func (*ResultsPtrCollection) AddJsoners

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

AddJsoners skip on nil

func (*ResultsPtrCollection) AddNonNilItems

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

AddNonNilItems skip on nil

func (*ResultsPtrCollection) AddNonNilItemsPtr

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

AddNonNilItemsPtr skip on nil

func (*ResultsPtrCollection) AddNonNilNonError

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

func (*ResultsPtrCollection) AddResult

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

func (*ResultsPtrCollection) AddResultsCollection

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

AddResultsCollection skip on nil items

func (*ResultsPtrCollection) AddSerializer

func (it *ResultsPtrCollection) AddSerializer(
	serializer bytesSerializer,
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddSerializerFunc

func (it *ResultsPtrCollection) AddSerializerFunc(
	serializerFunc func() ([]byte, error),
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddSerializerFunctions

func (it *ResultsPtrCollection) AddSerializerFunctions(
	serializerFunctions ...func() ([]byte, error),
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddSerializers

func (it *ResultsPtrCollection) AddSerializers(
	serializers ...bytesSerializer,
) *ResultsPtrCollection

func (*ResultsPtrCollection) AddSkipOnNil

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

AddSkipOnNil skip on nil

func (*ResultsPtrCollection) Adds

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

func (*ResultsPtrCollection) AllErrors

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

func (*ResultsPtrCollection) AsJsonContractsBinder

func (it *ResultsPtrCollection) AsJsonContractsBinder() JsonContractsBinder

func (*ResultsPtrCollection) AsJsonParseSelfInjector

func (it *ResultsPtrCollection) AsJsonParseSelfInjector() JsonParseSelfInjector

func (*ResultsPtrCollection) AsJsoner

func (it *ResultsPtrCollection) AsJsoner() Jsoner

func (*ResultsPtrCollection) Clear

func (*ResultsPtrCollection) Clone

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

func (*ResultsPtrCollection) Dispose

func (it *ResultsPtrCollection) Dispose()

func (*ResultsPtrCollection) FirstOrDefault

func (it *ResultsPtrCollection) FirstOrDefault() *Result

func (*ResultsPtrCollection) GetAt

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

func (*ResultsPtrCollection) GetAtSafe

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

func (*ResultsPtrCollection) GetAtSafeUsingLength

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

func (*ResultsPtrCollection) GetErrorsAsSingle

func (it *ResultsPtrCollection) GetErrorsAsSingle() error

func (*ResultsPtrCollection) GetErrorsAsSingleString

func (it *ResultsPtrCollection) GetErrorsAsSingleString() string

func (*ResultsPtrCollection) GetErrorsStrings

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

func (*ResultsPtrCollection) GetErrorsStringsPtr

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

func (*ResultsPtrCollection) GetPagedCollection

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

func (*ResultsPtrCollection) GetPagesSize

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

func (*ResultsPtrCollection) GetSinglePageCollection

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

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

func (*ResultsPtrCollection) GetStrings

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

func (*ResultsPtrCollection) GetStringsPtr

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

func (*ResultsPtrCollection) HasAnyItem

func (it *ResultsPtrCollection) HasAnyItem() bool

func (*ResultsPtrCollection) HasError

func (it *ResultsPtrCollection) HasError() bool

HasError has any error

func (*ResultsPtrCollection) InjectIntoAt

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

func (*ResultsPtrCollection) InjectIntoSameIndex

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

InjectIntoSameIndex any nil skip

func (*ResultsPtrCollection) IsEmpty

func (it *ResultsPtrCollection) IsEmpty() bool

func (ResultsPtrCollection) Json

func (it ResultsPtrCollection) Json() Result

func (*ResultsPtrCollection) JsonModel

func (it *ResultsPtrCollection) JsonModel() *ResultsPtrCollection

func (*ResultsPtrCollection) JsonModelAny

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

func (*ResultsPtrCollection) JsonParseSelfInject

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

func (ResultsPtrCollection) JsonPtr

func (it ResultsPtrCollection) JsonPtr() *Result

func (*ResultsPtrCollection) LastIndex

func (it *ResultsPtrCollection) LastIndex() int

func (*ResultsPtrCollection) LastOrDefault

func (it *ResultsPtrCollection) LastOrDefault() *Result

func (*ResultsPtrCollection) Length

func (it *ResultsPtrCollection) Length() int

func (*ResultsPtrCollection) Limit

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

func (ResultsPtrCollection) NonPtr

func (*ResultsPtrCollection) ParseInjectUsingJson

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

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

func (*ResultsPtrCollection) ParseInjectUsingJsonMust

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

ParseInjectUsingJsonMust Panic if error

func (*ResultsPtrCollection) Ptr

func (*ResultsPtrCollection) Skip

func (*ResultsPtrCollection) Take

func (*ResultsPtrCollection) UnmarshalAt

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

func (*ResultsPtrCollection) UnmarshalIntoSameIndex

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

UnmarshalIntoSameIndex any nil skip

type SimpleJsonBinder

type SimpleJsonBinder interface {
	Jsoner
	AsSimpleJsonBinder() SimpleJsonBinder
}

type SimpleJsoner

type SimpleJsoner interface {
	Jsoner
	JsonParseSelfInjector
}

Jump to

Keyboard shortcuts

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