coredynamic

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: 24 Imported by: 66

README

Readme

Questions and Answers

Diff between Elem and Indirect?

If a reflect.Value is a pointer, then v.Elem() is equivalent to reflect.Indirect(v). If it is not a pointer, then they are not equivalent:

If the value is an interface then reflect.Indirect(v) will return the same value, while v.Elem() will return the contained dynamic value. If the value is something else, then v.Elem() will panic. The reflect.Indirect helper is intended for cases where you want to accept either a particular type, or a pointer to that type. One example is the database/sql conversion routines: by using reflect.Indirect, it can use the same code paths to handle the various types and pointers to those types.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToReflectVal

func AnyToReflectVal(any interface{}) reflect.Value

func IsAnyTypesOf

func IsAnyTypesOf(
	typeLookup reflect.Type,
	acceptedTypes ...reflect.Type,
) (isFound bool)

func LengthOfReflect

func LengthOfReflect(reflectVal reflect.Value) int

func MustBeAcceptedTypes

func MustBeAcceptedTypes(
	input interface{},
	acceptedTypes ...reflect.Type,
)

func NotAcceptedTypesErr

func NotAcceptedTypesErr(
	input interface{},
	acceptedTypes ...reflect.Type,
) error

func PointerOrNonPointer

func PointerOrNonPointer(
	isPointerOutput bool,
	input interface{},
) (output interface{}, finalReflectVal reflect.Value)

func PointerOrNonPointerUsingReflectValue

func PointerOrNonPointerUsingReflectValue(
	isPointerOutput bool,
	rv reflect.Value,
) (output interface{}, finalReflectVal reflect.Value)

func ReflectInterfaceVal

func ReflectInterfaceVal(any interface{}) interface{}

ReflectInterfaceVal

Reduce pointer to value (one step only)

func ReflectKindValidation

func ReflectKindValidation(
	expectedKind reflect.Kind,
	anyItem interface{},
) error

func ReflectSetFromTo

func ReflectSetFromTo(
	from,
	toPointer interface{},
) error

ReflectSetFromTo

Set any object from to toPointer object

Valid Inputs or Supported (https://t.ly/SGWUx):

  • From, To: (null, null) -- do nothing
  • From, To: (sameTypePointer, sameTypePointer) -- try reflection
  • From, To: (sameTypeNonPointer, sameTypePointer) -- try reflection
  • From, To: ([]byte or *[]byte, otherType) -- try unmarshal, reflect
  • From, To: (otherType, *[]byte) -- try marshal, reflect

Validations:

  • Check null, if both null no error return quickly.
  • NotSupported returns as error.
  • NotSupported: (from, to) - (..., not pointer)
  • NotSupported: (from, to) - (null, notNull)
  • NotSupported: (from, to) - (notNull, null)
  • NotSupported: (from, to) - not same type and not bytes on any
  • `From` null or nil is not supported and will return error.

Reference:

func ReflectTypeValidation

func ReflectTypeValidation(
	isNotNullExpected bool,
	expectedType reflect.Type,
	anyItem interface{},
) error

func SafeTypeName

func SafeTypeName(any interface{}) string

func SafeZeroSet

func SafeZeroSet(rv reflect.Value)

func Type

func Type(any interface{}) reflect.Type

func TypeMustBeSame

func TypeMustBeSame(
	left, right interface{},
)

func TypeNotEqualErr

func TypeNotEqualErr(
	left, right interface{},
) error

func TypesIndexOf

func TypesIndexOf(
	typeLookup reflect.Type,
	acceptedTypes ...reflect.Type,
) (index int)

func ZeroSet

func ZeroSet(rvPointer reflect.Value)

ZeroSet

Sets empty bytes to the struct or the value but don't make it nil.

It only makes all fields to nil or zero values.

Warning :

  • Must be set as a pointer reflect value.

func ZeroSetAny

func ZeroSetAny(anyItem interface{})

ZeroSetAny

Sets empty bytes to the struct or the value but don't make it nil.

It only makes all fields to nil or zero values.

Warning :

  • Must be set as a pointer any.

Types

type AnyCollection

type AnyCollection struct {
	// contains filtered or unexported fields
}

func EmptyAnyCollection

func EmptyAnyCollection() *AnyCollection

func NewAnyCollection

func NewAnyCollection(capacity int) *AnyCollection

func (*AnyCollection) Add

func (it *AnyCollection) Add(anyItem interface{}) *AnyCollection

func (*AnyCollection) AddAny

func (it *AnyCollection) AddAny(anyItem interface{}, isValid bool) *AnyCollection

func (*AnyCollection) AddAnyItemsWithTypeValidation

func (it *AnyCollection) AddAnyItemsWithTypeValidation(
	isContinueOnError,
	isNullNotAllowed bool,
	expectedType reflect.Type,
	anyItems ...interface{},
) error

func (*AnyCollection) AddAnyManyDynamic

func (it *AnyCollection) AddAnyManyDynamic(anyItems ...interface{}) *AnyCollection

func (*AnyCollection) AddAnySliceFromSingleItem

func (it *AnyCollection) AddAnySliceFromSingleItem(
	sliceList interface{},
) *AnyCollection

func (*AnyCollection) AddAnyWithTypeValidation

func (it *AnyCollection) AddAnyWithTypeValidation(
	isNullNotAllowed bool,
	expectedType reflect.Type,
	anyItem interface{},
) error

func (*AnyCollection) AddMany

func (it *AnyCollection) AddMany(anyItems ...interface{}) *AnyCollection

func (*AnyCollection) AddNonNull

func (it *AnyCollection) AddNonNull(anyItem interface{}) *AnyCollection

func (*AnyCollection) AddNonNullDynamic

func (it *AnyCollection) AddNonNullDynamic(anyItem interface{}, isValid bool) *AnyCollection

func (*AnyCollection) At

func (it *AnyCollection) At(index int) interface{}

func (*AnyCollection) AtAsDynamic

func (it *AnyCollection) AtAsDynamic(index int) Dynamic

func (*AnyCollection) Count

func (it *AnyCollection) Count() int

func (*AnyCollection) DynamicCollection

func (it *AnyCollection) DynamicCollection() *DynamicCollection

func (*AnyCollection) DynamicItems

func (it *AnyCollection) DynamicItems() []Dynamic

func (*AnyCollection) First

func (it *AnyCollection) First() interface{}

func (*AnyCollection) FirstDynamic

func (it *AnyCollection) FirstDynamic() interface{}

func (*AnyCollection) FirstOrDefault

func (it *AnyCollection) FirstOrDefault() interface{}

func (*AnyCollection) FirstOrDefaultDynamic

func (it *AnyCollection) FirstOrDefaultDynamic() interface{}

func (*AnyCollection) GetPagedCollection

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

func (*AnyCollection) GetPagesSize

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

func (*AnyCollection) GetPagingInfo

func (it *AnyCollection) GetPagingInfo(
	eachPageSize int,
	pageIndex int,
) pagingutil.PagingInfo

func (*AnyCollection) GetSinglePageCollection

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

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

func (*AnyCollection) HasAnyItem

func (it *AnyCollection) HasAnyItem() bool

func (*AnyCollection) HasIndex

func (it *AnyCollection) HasIndex(index int) bool

func (*AnyCollection) IsEmpty

func (it *AnyCollection) IsEmpty() bool

func (*AnyCollection) Items

func (it *AnyCollection) Items() []interface{}

func (AnyCollection) Json

func (it AnyCollection) Json() corejson.Result

func (*AnyCollection) JsonModel

func (it *AnyCollection) JsonModel() []interface{}

func (*AnyCollection) JsonModelAny

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

func (*AnyCollection) JsonParseSelfInject

func (it *AnyCollection) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (AnyCollection) JsonPtr

func (it AnyCollection) JsonPtr() *corejson.Result

func (*AnyCollection) JsonResultsCollection

func (it *AnyCollection) JsonResultsCollection() *corejson.ResultsCollection

func (*AnyCollection) JsonResultsPtrCollection

func (it *AnyCollection) JsonResultsPtrCollection() *corejson.ResultsPtrCollection

func (*AnyCollection) JsonString

func (it *AnyCollection) JsonString() (jsonString string, err error)

func (*AnyCollection) JsonStringMust

func (it *AnyCollection) JsonStringMust() string

func (*AnyCollection) Last

func (it *AnyCollection) Last() interface{}

func (*AnyCollection) LastDynamic

func (it *AnyCollection) LastDynamic() interface{}

func (*AnyCollection) LastIndex

func (it *AnyCollection) LastIndex() int

func (*AnyCollection) LastOrDefault

func (it *AnyCollection) LastOrDefault() interface{}

func (*AnyCollection) LastOrDefaultDynamic

func (it *AnyCollection) LastOrDefaultDynamic() interface{}

func (*AnyCollection) Length

func (it *AnyCollection) Length() int

func (*AnyCollection) Limit

func (it *AnyCollection) Limit(limit int) []interface{}

func (*AnyCollection) LimitCollection

func (it *AnyCollection) LimitCollection(limit int) *AnyCollection

func (*AnyCollection) LimitDynamic

func (it *AnyCollection) LimitDynamic(limit int) interface{}

func (*AnyCollection) ListStrings

func (it *AnyCollection) ListStrings(isIncludeFieldName bool) []string

func (*AnyCollection) ListStringsPtr

func (it *AnyCollection) ListStringsPtr(isIncludeFieldName bool) *[]string

func (*AnyCollection) Loop

func (it *AnyCollection) Loop(
	isRunAsync bool,
	loopProcessorFunc func(index int, item interface{}) (isBreak bool),
) *AnyCollection

func (*AnyCollection) LoopDynamic

func (it *AnyCollection) LoopDynamic(
	isRunAsync bool,
	loopProcessorFunc func(index int, item Dynamic) (isBreak bool),
) *AnyCollection

func (*AnyCollection) MarshalJSON

func (it *AnyCollection) MarshalJSON() ([]byte, error)

func (*AnyCollection) ParseInjectUsingJson

func (it *AnyCollection) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*AnyCollection, error)

func (*AnyCollection) ParseInjectUsingJsonMust

func (it *AnyCollection) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *AnyCollection

func (*AnyCollection) ReflectSetAt

func (it *AnyCollection) ReflectSetAt(
	index int,
	toPointerOrBytesSet interface{},
) error

func (*AnyCollection) RemoveAt

func (it *AnyCollection) RemoveAt(index int) (isSuccess bool)

func (*AnyCollection) SafeLimitCollection

func (it *AnyCollection) SafeLimitCollection(limit int) *AnyCollection

func (*AnyCollection) Skip

func (it *AnyCollection) Skip(skippingItemsCount int) []interface{}

func (*AnyCollection) SkipCollection

func (it *AnyCollection) SkipCollection(skippingItemsCount int) *AnyCollection

func (*AnyCollection) SkipDynamic

func (it *AnyCollection) SkipDynamic(skippingItemsCount int) interface{}

func (*AnyCollection) String

func (it *AnyCollection) String() string

func (*AnyCollection) Strings

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

func (*AnyCollection) Take

func (it *AnyCollection) Take(takeDynamicItems int) []interface{}

func (*AnyCollection) TakeCollection

func (it *AnyCollection) TakeCollection(takeDynamicItems int) *AnyCollection

func (*AnyCollection) TakeDynamic

func (it *AnyCollection) TakeDynamic(takeDynamicItems int) interface{}

func (*AnyCollection) UnmarshalJSON

func (it *AnyCollection) UnmarshalJSON(data []byte) error

type BytesConverter

type BytesConverter struct {
	// contains filtered or unexported fields
}

func NewBytesConverter

func NewBytesConverter(
	rawBytes []byte,
) *BytesConverter

func NewBytesConverterUsingJsonResult

func NewBytesConverterUsingJsonResult(
	jsonResult *corejson.Result,
) (*BytesConverter, error)

func (BytesConverter) CastString

func (it BytesConverter) CastString() (line string, err error)

func (BytesConverter) Deserialize

func (it BytesConverter) Deserialize(
	deserializePointer interface{},
) error

func (BytesConverter) DeserializeMust

func (it BytesConverter) DeserializeMust(
	deserializePointer interface{},
)

func (BytesConverter) SafeCastString

func (it BytesConverter) SafeCastString() (line string)

func (BytesConverter) ToAnyCollection

func (it BytesConverter) ToAnyCollection() (anyCollection *AnyCollection, err error)

func (BytesConverter) ToBool

func (it BytesConverter) ToBool() (isResult bool, err error)

func (BytesConverter) ToBoolMust

func (it BytesConverter) ToBoolMust() (isResult bool)

func (BytesConverter) ToBytesCollection

func (it BytesConverter) ToBytesCollection() (
	bytesCollection *corejson.BytesCollection, err error,
)

func (BytesConverter) ToCollection

func (it BytesConverter) ToCollection() (collection *corestr.Collection, err error)

func (BytesConverter) ToCollectionMust

func (it BytesConverter) ToCollectionMust() (collection *corestr.Collection)

func (BytesConverter) ToDynamicCollection

func (it BytesConverter) ToDynamicCollection() (dynamicCollection *DynamicCollection, err error)

func (BytesConverter) ToHashmap

func (it BytesConverter) ToHashmap() (hashmap *corestr.Hashmap, err error)

func (BytesConverter) ToHashmapMust

func (it BytesConverter) ToHashmapMust() (hashmap *corestr.Hashmap)

func (BytesConverter) ToHashset

func (it BytesConverter) ToHashset() (hashset *corestr.Hashset, err error)

func (BytesConverter) ToHashsetMust

func (it BytesConverter) ToHashsetMust() (hashset *corestr.Hashset)

func (BytesConverter) ToInt64

func (it BytesConverter) ToInt64() (integer64 int64, err error)

func (BytesConverter) ToInt64Must

func (it BytesConverter) ToInt64Must() (integer64 int64)

func (BytesConverter) ToJsonMapResults

func (it BytesConverter) ToJsonMapResults() (
	jsonMapResults *corejson.MapResults, err error,
)

func (BytesConverter) ToJsonResultCollection

func (it BytesConverter) ToJsonResultCollection() (
	jsonResultCollection *corejson.ResultsCollection, err error,
)

func (BytesConverter) ToKeyValCollection

func (it BytesConverter) ToKeyValCollection() (keyValCollection *KeyValCollection, err error)

func (BytesConverter) ToMapAnyItems

func (it BytesConverter) ToMapAnyItems() (mapAnyItems *MapAnyItems, err error)

func (BytesConverter) ToSimpleSlice

func (it BytesConverter) ToSimpleSlice() (simpleSlice *corestr.SimpleSlice, err error)

func (BytesConverter) ToSimpleSliceMust

func (it BytesConverter) ToSimpleSliceMust() (simpleSlice *corestr.SimpleSlice)

func (BytesConverter) ToString

func (it BytesConverter) ToString() (line string, err error)

func (BytesConverter) ToStringMust

func (it BytesConverter) ToStringMust() (line string)

func (BytesConverter) ToStrings

func (it BytesConverter) ToStrings() (lines []string, err error)

func (BytesConverter) ToStringsMust

func (it BytesConverter) ToStringsMust() (lines []string)

type CastedResult

type CastedResult struct {
	Casted                         interface{}
	SourceReflectType              reflect.Type
	SourceKind                     reflect.Kind
	Error                          error
	IsNull, IsMatchingAcceptedType bool
	IsValid                        bool
	IsPointer                      bool // refers to how returned, ptr or non ptr
	IsSourcePointer                bool
}

func CastTo

func CastTo(
	isOutputPointer bool,
	input interface{},
	acceptedTypes ...reflect.Type,
) CastedResult

func (*CastedResult) HasAnyIssues

func (it *CastedResult) HasAnyIssues() bool

func (*CastedResult) HasError

func (it *CastedResult) HasError() bool

func (*CastedResult) IsInvalid

func (it *CastedResult) IsInvalid() bool

func (*CastedResult) IsNotMatchingAcceptedType

func (it *CastedResult) IsNotMatchingAcceptedType() bool

func (*CastedResult) IsNotNull

func (it *CastedResult) IsNotNull() bool

func (*CastedResult) IsNotPointer

func (it *CastedResult) IsNotPointer() bool

func (*CastedResult) IsSourceKind

func (it *CastedResult) IsSourceKind(kind reflect.Kind) bool

type Dynamic

type Dynamic struct {
	// contains filtered or unexported fields
}

func InvalidDynamic

func InvalidDynamic() Dynamic

func InvalidDynamicPtr

func InvalidDynamicPtr() *Dynamic

func NewDynamic

func NewDynamic(
	data interface{},
	isValid bool,
) Dynamic

func NewDynamicPtr

func NewDynamicPtr(
	data interface{},
	isValid bool,
) *Dynamic

func NewDynamicValid

func NewDynamicValid(
	data interface{},
) Dynamic

func (*Dynamic) Bytes

func (it *Dynamic) Bytes() (rawBytes []byte, isSuccess bool)

func (Dynamic) Clone

func (it Dynamic) Clone() Dynamic

func (*Dynamic) ClonePtr

func (it *Dynamic) ClonePtr() *Dynamic

func (*Dynamic) ConvertUsingFunc

func (it *Dynamic) ConvertUsingFunc(
	converter SimpleInOutConverter,
	expectedType reflect.Type,
) *SimpleResult

func (*Dynamic) Data

func (it *Dynamic) Data() interface{}

func (*Dynamic) Deserialize

func (it *Dynamic) Deserialize(jsonBytes []byte) (deserialized *Dynamic, err error)

func (*Dynamic) FilterAsDynamicCollection

func (it *Dynamic) FilterAsDynamicCollection(
	filterFunc func(index int, itemAsDynamic Dynamic) (isTake, isBreak bool),
) *DynamicCollection

func (*Dynamic) Float64

func (it *Dynamic) Float64() (val float64, err error)

func (*Dynamic) IntDefault

func (it *Dynamic) IntDefault(defaultInt int) (val int, isSuccess bool)

func (*Dynamic) IsFunc

func (it *Dynamic) IsFunc() bool

func (*Dynamic) IsInvalid

func (it *Dynamic) IsInvalid() bool

func (*Dynamic) IsMap

func (it *Dynamic) IsMap() bool

func (*Dynamic) IsNull

func (it *Dynamic) IsNull() bool

func (*Dynamic) IsNumber

func (it *Dynamic) IsNumber() bool

IsNumber true if float (any), byte, int (any), uint(any)

func (*Dynamic) IsPointer

func (it *Dynamic) IsPointer() bool

func (*Dynamic) IsPrimitive

func (it *Dynamic) IsPrimitive() bool

func (*Dynamic) IsReflectKind

func (it *Dynamic) IsReflectKind(checkingKind reflect.Kind) bool

func (*Dynamic) IsReflectTypeOf

func (it *Dynamic) IsReflectTypeOf(
	typeRequest reflect.Type,
) bool

func (*Dynamic) IsSliceOrArray

func (it *Dynamic) IsSliceOrArray() bool

func (*Dynamic) IsSliceOrArrayOrMap

func (it *Dynamic) IsSliceOrArrayOrMap() bool

func (*Dynamic) IsStringType

func (it *Dynamic) IsStringType() bool

func (*Dynamic) IsStruct

func (it *Dynamic) IsStruct() bool

func (*Dynamic) IsStructStringNullOrEmpty

func (it *Dynamic) IsStructStringNullOrEmpty() bool

func (*Dynamic) IsStructStringNullOrEmptyOrWhitespace

func (it *Dynamic) IsStructStringNullOrEmptyOrWhitespace() bool

func (*Dynamic) IsValid

func (it *Dynamic) IsValid() bool

func (*Dynamic) IsValueType

func (it *Dynamic) IsValueType() bool

func (*Dynamic) ItemReflectValueUsingIndex

func (it *Dynamic) ItemReflectValueUsingIndex(index int) reflect.Value

func (*Dynamic) ItemReflectValueUsingKey

func (it *Dynamic) ItemReflectValueUsingKey(key interface{}) reflect.Value

func (*Dynamic) ItemUsingIndex

func (it *Dynamic) ItemUsingIndex(index int) interface{}

func (*Dynamic) ItemUsingKey

func (it *Dynamic) ItemUsingKey(key interface{}) interface{}

func (Dynamic) Json

func (it Dynamic) Json() corejson.Result

func (*Dynamic) JsonBytes

func (it *Dynamic) JsonBytes() (jsonBytesPtr []byte, err error)

func (*Dynamic) JsonBytesPtr

func (it *Dynamic) JsonBytesPtr() (jsonBytesPtr *[]byte, err error)

JsonBytesPtr returns empty string on nil. no error on nil.

func (*Dynamic) JsonModel

func (it *Dynamic) JsonModel() interface{}

func (*Dynamic) JsonModelAny

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

func (*Dynamic) JsonParseSelfInject

func (it *Dynamic) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (*Dynamic) JsonPayloadMust

func (it *Dynamic) JsonPayloadMust() (jsonBytes []byte)

func (Dynamic) JsonPtr

func (it Dynamic) JsonPtr() *corejson.Result

func (*Dynamic) JsonString

func (it *Dynamic) JsonString() (jsonString string, err error)

func (*Dynamic) JsonStringMust

func (it *Dynamic) JsonStringMust() string

func (*Dynamic) Length

func (it *Dynamic) Length() int

Length Returns length of a slice, map, array

It will also reduce from pointer

Reference : https://cutt.ly/PnaWAFn | https://cutt.ly/jnaEig8 | https://play.golang.org/p/UCORoShXlv1

func (*Dynamic) Loop

func (it *Dynamic) Loop(
	loopProcessorFunc func(index int, item interface{}) (isBreak bool),
) (isCalled bool)

func (*Dynamic) LoopMap

func (it *Dynamic) LoopMap(
	mapLoopProcessorFunc func(index int, key, value interface{}) (isBreak bool),
) (isCalled bool)

func (*Dynamic) MapToKeyVal

func (it *Dynamic) MapToKeyVal() (*KeyValCollection, error)

func (*Dynamic) MarshalJSON

func (it *Dynamic) MarshalJSON() ([]byte, error)

func (Dynamic) NonPtr

func (it Dynamic) NonPtr() Dynamic

func (*Dynamic) ParseInjectUsingJson

func (it *Dynamic) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*Dynamic, error)

func (*Dynamic) ParseInjectUsingJsonMust

func (it *Dynamic) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *Dynamic

ParseInjectUsingJsonMust Panic if error

func (*Dynamic) Ptr

func (it *Dynamic) Ptr() *Dynamic

func (*Dynamic) ReflectKind

func (it *Dynamic) ReflectKind() reflect.Kind

func (*Dynamic) ReflectSetTo

func (it *Dynamic) ReflectSetTo(toPointer interface{}) error

func (*Dynamic) ReflectType

func (it *Dynamic) ReflectType() reflect.Type

func (*Dynamic) ReflectTypeName

func (it *Dynamic) ReflectTypeName() string

func (*Dynamic) ReflectValue

func (it *Dynamic) ReflectValue() *reflect.Value

func (*Dynamic) String

func (it *Dynamic) String() string

func (*Dynamic) StructString

func (it *Dynamic) StructString() string

func (*Dynamic) StructStringPtr

func (it *Dynamic) StructStringPtr() *string

func (*Dynamic) UnmarshalJSON

func (it *Dynamic) UnmarshalJSON(data []byte) error

func (*Dynamic) Value

func (it *Dynamic) Value() interface{}

func (*Dynamic) ValueBool

func (it *Dynamic) ValueBool() bool

func (*Dynamic) ValueInt

func (it *Dynamic) ValueInt() int

func (*Dynamic) ValueInt64

func (it *Dynamic) ValueInt64() int64

func (*Dynamic) ValueMarshal

func (it *Dynamic) ValueMarshal() (jsonBytes []byte, err error)

func (*Dynamic) ValueNullErr

func (it *Dynamic) ValueNullErr() error

func (*Dynamic) ValueString

func (it *Dynamic) ValueString() string

func (*Dynamic) ValueStrings

func (it *Dynamic) ValueStrings() []string

func (*Dynamic) ValueUInt

func (it *Dynamic) ValueUInt() uint

type DynamicCollection

type DynamicCollection struct {
	// contains filtered or unexported fields
}

func EmptyDynamicCollection

func EmptyDynamicCollection() *DynamicCollection

func NewDynamicCollection

func NewDynamicCollection(capacity int) *DynamicCollection

func (*DynamicCollection) Add

func (it *DynamicCollection) Add(
	dynamic Dynamic,
) *DynamicCollection

func (*DynamicCollection) AddAny

func (it *DynamicCollection) AddAny(
	anyItem interface{}, isValid bool,
) *DynamicCollection

func (*DynamicCollection) AddAnyItemsWithTypeValidation

func (it *DynamicCollection) AddAnyItemsWithTypeValidation(
	isContinueOnError,
	isNullNotAllowed bool,
	expectedType reflect.Type,
	anyItems ...interface{},
) error

func (*DynamicCollection) AddAnyMany

func (it *DynamicCollection) AddAnyMany(
	anyItems ...interface{},
) *DynamicCollection

func (*DynamicCollection) AddAnyNonNull

func (it *DynamicCollection) AddAnyNonNull(
	anyItem interface{}, isValid bool,
) *DynamicCollection

func (*DynamicCollection) AddAnySliceFromSingleItem

func (it *DynamicCollection) AddAnySliceFromSingleItem(
	isValid bool,
	sliceList interface{},
) *DynamicCollection

func (*DynamicCollection) AddAnyWithTypeValidation

func (it *DynamicCollection) AddAnyWithTypeValidation(
	isNullNotAllowed bool,
	expectedType reflect.Type,
	anyItem interface{},
) error

func (*DynamicCollection) AddManyPtr

func (it *DynamicCollection) AddManyPtr(
	dynamicItems ...*Dynamic,
) *DynamicCollection

func (*DynamicCollection) AddPtr

func (it *DynamicCollection) AddPtr(
	dynamic *Dynamic,
) *DynamicCollection

func (*DynamicCollection) AnyItems

func (it *DynamicCollection) AnyItems() []interface{}

func (*DynamicCollection) AnyItemsCollection

func (it *DynamicCollection) AnyItemsCollection() *AnyCollection

func (*DynamicCollection) At

func (it *DynamicCollection) At(index int) Dynamic

func (*DynamicCollection) Count

func (it *DynamicCollection) Count() int

func (*DynamicCollection) First

func (it *DynamicCollection) First() Dynamic

func (*DynamicCollection) FirstDynamic

func (it *DynamicCollection) FirstDynamic() interface{}

func (*DynamicCollection) FirstOrDefault

func (it *DynamicCollection) FirstOrDefault() *Dynamic

func (*DynamicCollection) FirstOrDefaultDynamic

func (it *DynamicCollection) FirstOrDefaultDynamic() interface{}

func (*DynamicCollection) GetPagedCollection

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

func (*DynamicCollection) GetPagesSize

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

func (*DynamicCollection) GetPagingInfo

func (it *DynamicCollection) GetPagingInfo(
	eachPageSize int,
	pageIndex int,
) pagingutil.PagingInfo

func (*DynamicCollection) GetSinglePageCollection

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

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

func (*DynamicCollection) HasAnyItem

func (it *DynamicCollection) HasAnyItem() bool

func (*DynamicCollection) HasIndex

func (it *DynamicCollection) HasIndex(index int) bool

func (*DynamicCollection) IsEmpty

func (it *DynamicCollection) IsEmpty() bool

func (*DynamicCollection) Items

func (it *DynamicCollection) Items() []Dynamic

func (DynamicCollection) Json

func (it DynamicCollection) Json() corejson.Result

func (*DynamicCollection) JsonModel

func (it *DynamicCollection) JsonModel() DynamicCollectionModel

func (*DynamicCollection) JsonModelAny

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

func (*DynamicCollection) JsonParseSelfInject

func (it *DynamicCollection) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (DynamicCollection) JsonPtr

func (it DynamicCollection) JsonPtr() *corejson.Result

func (*DynamicCollection) JsonResultsCollection

func (it *DynamicCollection) JsonResultsCollection() *corejson.ResultsCollection

func (*DynamicCollection) JsonResultsPtrCollection

func (it *DynamicCollection) JsonResultsPtrCollection() *corejson.ResultsPtrCollection

func (*DynamicCollection) JsonString

func (it *DynamicCollection) JsonString() (jsonString string, err error)

func (*DynamicCollection) JsonStringMust

func (it *DynamicCollection) JsonStringMust() string

func (*DynamicCollection) Last

func (it *DynamicCollection) Last() Dynamic

func (*DynamicCollection) LastDynamic

func (it *DynamicCollection) LastDynamic() interface{}

func (*DynamicCollection) LastIndex

func (it *DynamicCollection) LastIndex() int

func (*DynamicCollection) LastOrDefault

func (it *DynamicCollection) LastOrDefault() *Dynamic

func (*DynamicCollection) LastOrDefaultDynamic

func (it *DynamicCollection) LastOrDefaultDynamic() interface{}

func (*DynamicCollection) Length

func (it *DynamicCollection) Length() int

func (*DynamicCollection) Limit

func (it *DynamicCollection) Limit(limit int) []Dynamic

func (*DynamicCollection) LimitCollection

func (it *DynamicCollection) LimitCollection(limit int) *DynamicCollection

func (*DynamicCollection) LimitDynamic

func (it *DynamicCollection) LimitDynamic(limit int) interface{}

func (*DynamicCollection) ListStrings

func (it *DynamicCollection) ListStrings() []string

func (*DynamicCollection) ListStringsPtr

func (it *DynamicCollection) ListStringsPtr() *[]string

func (*DynamicCollection) Loop

func (it *DynamicCollection) Loop(
	loopProcessorFunc func(index int, dynamicItem *Dynamic) (isBreak bool),
)

func (*DynamicCollection) MarshalJSON

func (it *DynamicCollection) MarshalJSON() ([]byte, error)

func (*DynamicCollection) ParseInjectUsingJson

func (it *DynamicCollection) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*DynamicCollection, error)

func (*DynamicCollection) ParseInjectUsingJsonMust

func (it *DynamicCollection) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *DynamicCollection

func (*DynamicCollection) RemoveAt

func (it *DynamicCollection) RemoveAt(index int) (isSuccess bool)

func (*DynamicCollection) SafeLimitCollection

func (it *DynamicCollection) SafeLimitCollection(limit int) *DynamicCollection

func (*DynamicCollection) Skip

func (it *DynamicCollection) Skip(skippingItemsCount int) []Dynamic

func (*DynamicCollection) SkipCollection

func (it *DynamicCollection) SkipCollection(skippingItemsCount int) *DynamicCollection

func (*DynamicCollection) SkipDynamic

func (it *DynamicCollection) SkipDynamic(skippingItemsCount int) interface{}

func (*DynamicCollection) String

func (it *DynamicCollection) String() string

func (*DynamicCollection) Strings

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

func (*DynamicCollection) Take

func (it *DynamicCollection) Take(takeDynamicItems int) []Dynamic

func (*DynamicCollection) TakeCollection

func (it *DynamicCollection) TakeCollection(takeDynamicItems int) *DynamicCollection

func (*DynamicCollection) TakeDynamic

func (it *DynamicCollection) TakeDynamic(takeDynamicItems int) interface{}

func (*DynamicCollection) UnmarshalJSON

func (it *DynamicCollection) UnmarshalJSON(data []byte) error

type DynamicCollectionModel

type DynamicCollectionModel struct {
	Items []Dynamic
}

type DynamicStatus

type DynamicStatus struct {
	Dynamic
	Index   int
	Message string
}

func InvalidDynamicStatus

func InvalidDynamicStatus(message string) *DynamicStatus

func InvalidDynamicStatusNoMessage

func InvalidDynamicStatusNoMessage() *DynamicStatus

func (DynamicStatus) Clone

func (it DynamicStatus) Clone() DynamicStatus

Clone Warning: Cannot clone dynamic data or interface properly but set it again

If it is a pointer one needs to copy it manually.

func (*DynamicStatus) ClonePtr

func (it *DynamicStatus) ClonePtr() *DynamicStatus

type KeyVal

type KeyVal struct {
	Key   interface{}
	Value interface{}
}

func (*KeyVal) CastKeyVal

func (it *KeyVal) CastKeyVal(
	keyToPointer,
	valueToPointer interface{},
) error

func (*KeyVal) IsKeyNull

func (it *KeyVal) IsKeyNull() bool

func (*KeyVal) IsKeyNullOrEmptyString

func (it *KeyVal) IsKeyNullOrEmptyString() bool

func (*KeyVal) IsValueNull

func (it *KeyVal) IsValueNull() bool

func (KeyVal) Json

func (it KeyVal) Json() corejson.Result

func (KeyVal) JsonModel

func (it KeyVal) JsonModel() interface{}

func (KeyVal) JsonModelAny

func (it KeyVal) JsonModelAny() interface{}

func (*KeyVal) JsonParseSelfInject

func (it *KeyVal) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (KeyVal) JsonPtr

func (it KeyVal) JsonPtr() *corejson.Result

func (*KeyVal) KeyDynamic

func (it *KeyVal) KeyDynamic() Dynamic

func (*KeyVal) KeyDynamicPtr

func (it *KeyVal) KeyDynamicPtr() *Dynamic

func (*KeyVal) KeyNullErr

func (it *KeyVal) KeyNullErr() error

func (*KeyVal) KeyReflectSet

func (it *KeyVal) KeyReflectSet(toPointer interface{}) error

func (*KeyVal) KeyString

func (it *KeyVal) KeyString() string

func (*KeyVal) ParseInjectUsingJson

func (it *KeyVal) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*KeyVal, error)

func (*KeyVal) ParseInjectUsingJsonMust

func (it *KeyVal) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *KeyVal

ParseInjectUsingJsonMust Panic if error

func (*KeyVal) ReflectSetKey

func (it *KeyVal) ReflectSetKey(
	keyToPointer interface{},
) error

func (*KeyVal) ReflectSetTo

func (it *KeyVal) ReflectSetTo(toPointer interface{}) error

func (*KeyVal) ReflectSetToMust

func (it *KeyVal) ReflectSetToMust(toPointer interface{})

func (*KeyVal) Serialize

func (it *KeyVal) Serialize() (jsonBytesPtr []byte, err error)

func (*KeyVal) String

func (it *KeyVal) String() string

func (*KeyVal) ValueBool

func (it *KeyVal) ValueBool() bool

func (*KeyVal) ValueDynamic

func (it *KeyVal) ValueDynamic() Dynamic

func (*KeyVal) ValueDynamicPtr

func (it *KeyVal) ValueDynamicPtr() *Dynamic

func (*KeyVal) ValueInt

func (it *KeyVal) ValueInt() int

func (*KeyVal) ValueInt64

func (it *KeyVal) ValueInt64() int64

func (*KeyVal) ValueNullErr

func (it *KeyVal) ValueNullErr() error

func (*KeyVal) ValueReflectSet

func (it *KeyVal) ValueReflectSet(toPointer interface{}) error

func (*KeyVal) ValueReflectValue

func (it *KeyVal) ValueReflectValue() reflect.Value

func (*KeyVal) ValueString

func (it *KeyVal) ValueString() string

func (*KeyVal) ValueStrings

func (it *KeyVal) ValueStrings() []string

func (*KeyVal) ValueUInt

func (it *KeyVal) ValueUInt() uint

type KeyValCollection

type KeyValCollection struct {
	// contains filtered or unexported fields
}

func EmptyKeyValCollection

func EmptyKeyValCollection() *KeyValCollection

func MapAsKeyValSlice

func MapAsKeyValSlice(reflectVal reflect.Value) (*KeyValCollection, error)

MapAsKeyValSlice

expectation : map[key:interface{}]interface{}

func NewKeyValCollection

func NewKeyValCollection(capacity int) *KeyValCollection

func (*KeyValCollection) Add

func (it *KeyValCollection) Add(
	keyVal KeyVal,
) *KeyValCollection

func (*KeyValCollection) AddMany

func (it *KeyValCollection) AddMany(
	keyValues ...KeyVal,
) *KeyValCollection

func (*KeyValCollection) AddManyPtr

func (it *KeyValCollection) AddManyPtr(
	keyValues ...*KeyVal,
) *KeyValCollection

func (*KeyValCollection) AddPtr

func (it *KeyValCollection) AddPtr(
	keyVal *KeyVal,
) *KeyValCollection

func (*KeyValCollection) AllKeys

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

func (*KeyValCollection) AllKeysSorted

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

func (*KeyValCollection) AllValues

func (it *KeyValCollection) AllValues() []interface{}

func (KeyValCollection) Clone

func (*KeyValCollection) ClonePtr

func (it *KeyValCollection) ClonePtr() *KeyValCollection

func (*KeyValCollection) GetPagedCollection

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

func (*KeyValCollection) GetPagesSize

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

func (*KeyValCollection) GetPagingInfo

func (it *KeyValCollection) GetPagingInfo(
	eachPageSize int,
	pageIndex int,
) pagingutil.PagingInfo

func (*KeyValCollection) GetSinglePageCollection

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

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

func (*KeyValCollection) HasAnyItem

func (it *KeyValCollection) HasAnyItem() bool

func (*KeyValCollection) IsEmpty

func (it *KeyValCollection) IsEmpty() bool

func (*KeyValCollection) Items

func (it *KeyValCollection) Items() []KeyVal

func (KeyValCollection) Json

func (it KeyValCollection) Json() corejson.Result

func (*KeyValCollection) JsonMapResults

func (it *KeyValCollection) JsonMapResults() (*corejson.MapResults, error)

func (KeyValCollection) JsonModel

func (it KeyValCollection) JsonModel() interface{}

func (KeyValCollection) JsonModelAny

func (it KeyValCollection) JsonModelAny() interface{}

func (*KeyValCollection) JsonParseSelfInject

func (it *KeyValCollection) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (KeyValCollection) JsonPtr

func (it KeyValCollection) JsonPtr() *corejson.Result

func (*KeyValCollection) JsonResultsCollection

func (it *KeyValCollection) JsonResultsCollection() *corejson.ResultsCollection

func (*KeyValCollection) JsonResultsPtrCollection

func (it *KeyValCollection) JsonResultsPtrCollection() *corejson.ResultsPtrCollection

func (*KeyValCollection) JsonString

func (it *KeyValCollection) JsonString() (jsonString string, err error)

func (*KeyValCollection) JsonStringMust

func (it *KeyValCollection) JsonStringMust() string

func (*KeyValCollection) Length

func (it *KeyValCollection) Length() int

func (*KeyValCollection) MapAnyItems

func (it *KeyValCollection) MapAnyItems() *MapAnyItems

func (KeyValCollection) NonPtr

func (it KeyValCollection) NonPtr() KeyValCollection

func (*KeyValCollection) ParseInjectUsingJson

func (it *KeyValCollection) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*KeyValCollection, error)

func (*KeyValCollection) ParseInjectUsingJsonMust

func (it *KeyValCollection) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *KeyValCollection

ParseInjectUsingJsonMust Panic if error

func (*KeyValCollection) Ptr

func (*KeyValCollection) Serialize

func (it *KeyValCollection) Serialize() (jsonBytesPtr []byte, err error)

func (*KeyValCollection) String

func (it *KeyValCollection) String() string

type LeftRight

type LeftRight struct {
	Left, Right interface{}
}

func (*LeftRight) DeserializeLeft

func (it *LeftRight) DeserializeLeft() *corejson.Result

func (*LeftRight) DeserializeRight

func (it *LeftRight) DeserializeRight() *corejson.Result

func (*LeftRight) HasAnyItem

func (it *LeftRight) HasAnyItem() bool

func (*LeftRight) HasLeft

func (it *LeftRight) HasLeft() bool

func (*LeftRight) HasRight

func (it *LeftRight) HasRight() bool

func (*LeftRight) IsEmpty

func (it *LeftRight) IsEmpty() bool

func (*LeftRight) IsLeftEmpty

func (it *LeftRight) IsLeftEmpty() bool

func (*LeftRight) IsRightEmpty

func (it *LeftRight) IsRightEmpty() bool

func (*LeftRight) LeftReflectSet

func (it *LeftRight) LeftReflectSet(
	toPointerOrBytesPointer interface{},
) error

func (*LeftRight) LeftToDynamic

func (it *LeftRight) LeftToDynamic() *Dynamic

func (*LeftRight) RightReflectSet

func (it *LeftRight) RightReflectSet(
	toPointerOrBytesPointer interface{},
) error

func (*LeftRight) RightToDynamic

func (it *LeftRight) RightToDynamic() *Dynamic

func (*LeftRight) TypeStatus

func (it *LeftRight) TypeStatus() TypeStatus

type MapAnyItemDiff

type MapAnyItemDiff map[string]interface{}

func (MapAnyItemDiff) AllKeysSorted

func (it MapAnyItemDiff) AllKeysSorted() []string

func (*MapAnyItemDiff) Clear

func (it *MapAnyItemDiff) Clear() MapAnyItemDiff

func (*MapAnyItemDiff) DiffJsonMessage

func (it *MapAnyItemDiff) DiffJsonMessage(
	isRegardlessType bool,
	rightMap map[string]interface{},
) string

func (*MapAnyItemDiff) DiffRaw

func (it *MapAnyItemDiff) DiffRaw(
	isRegardlessType bool,
	rightMap map[string]interface{},
) map[string]interface{}

func (*MapAnyItemDiff) HasAnyChanges

func (it *MapAnyItemDiff) HasAnyChanges(
	isRegardlessType bool,
	rightMap map[string]interface{},
) bool

func (MapAnyItemDiff) HasAnyItem

func (it MapAnyItemDiff) HasAnyItem() bool

func (*MapAnyItemDiff) HashmapDiffUsingRaw

func (it *MapAnyItemDiff) HashmapDiffUsingRaw(
	isRegardlessType bool,
	rightMap map[string]interface{},
) MapAnyItemDiff

func (MapAnyItemDiff) IsEmpty

func (it MapAnyItemDiff) IsEmpty() bool

func (*MapAnyItemDiff) IsRawEqual

func (it *MapAnyItemDiff) IsRawEqual(
	isRegardlessType bool,
	rightMap map[string]interface{},
) bool

func (MapAnyItemDiff) Json

func (it MapAnyItemDiff) Json() corejson.Result

func (MapAnyItemDiff) JsonPtr

func (it MapAnyItemDiff) JsonPtr() *corejson.Result

func (MapAnyItemDiff) LastIndex

func (it MapAnyItemDiff) LastIndex() int

func (*MapAnyItemDiff) Length

func (it *MapAnyItemDiff) Length() int

func (MapAnyItemDiff) LogPrettyJsonString

func (it MapAnyItemDiff) LogPrettyJsonString()

func (*MapAnyItemDiff) LogShouldDiffMessage

func (it *MapAnyItemDiff) LogShouldDiffMessage(
	isRegardlessType bool,
	title string,
	rightMap map[string]interface{},
) (diffMessage string)

func (*MapAnyItemDiff) MapAnyItems

func (it *MapAnyItemDiff) MapAnyItems() *MapAnyItems

func (MapAnyItemDiff) PrettyJsonString

func (it MapAnyItemDiff) PrettyJsonString() string

func (*MapAnyItemDiff) Raw

func (it *MapAnyItemDiff) Raw() map[string]interface{}

func (*MapAnyItemDiff) RawMapDiffer

func (it *MapAnyItemDiff) RawMapDiffer() mapdiffinternal.MapStringAnyDiff

func (*MapAnyItemDiff) ShouldDiffMessage

func (it *MapAnyItemDiff) ShouldDiffMessage(
	isRegardlessType bool,
	title string,
	rightMap map[string]interface{},
) string

func (*MapAnyItemDiff) ToStringsSliceOfDiffMap

func (it *MapAnyItemDiff) ToStringsSliceOfDiffMap(
	diffMap map[string]interface{},
) (diffSlice []string)

type MapAnyItems

type MapAnyItems struct {
	Items map[string]interface{}
}

func EmptyMapAnyItems

func EmptyMapAnyItems() *MapAnyItems

func NewMapAnyItems

func NewMapAnyItems(capacity int) *MapAnyItems

func NewMapAnyItemsUsingAnyTypeMap

func NewMapAnyItemsUsingAnyTypeMap(
	anyTypeOfMap interface{},
) (*MapAnyItems, error)

func NewMapAnyItemsUsingItems

func NewMapAnyItemsUsingItems(
	itemsMap map[string]interface{},
) *MapAnyItems

func (*MapAnyItems) Add

func (it *MapAnyItems) Add(
	key string,
	valInf interface{},
) (isNewlyAdded bool)

func (*MapAnyItems) AddJsonResultPtr

func (it *MapAnyItems) AddJsonResultPtr(
	key string,
	jsonResult *corejson.Result,
) *MapAnyItems

func (*MapAnyItems) AddKeyAny

func (it *MapAnyItems) AddKeyAny(
	keyAny corejson.KeyAny,
) (isNewlyAdded bool)

func (*MapAnyItems) AddKeyAnyWithValidation

func (it *MapAnyItems) AddKeyAnyWithValidation(
	typeVerify reflect.Type,
	keyAny corejson.KeyAny,
) error

func (*MapAnyItems) AddManyMapResultsUsingOption

func (it *MapAnyItems) AddManyMapResultsUsingOption(
	isOverridingExisting bool,
	mapsOfMapsResults ...map[string]interface{},
) *MapAnyItems

func (*MapAnyItems) AddMapResult

func (it *MapAnyItems) AddMapResult(
	mapResults map[string]interface{},
) *MapAnyItems

AddMapResult

apply override on existing result

func (*MapAnyItems) AddMapResultOption

func (it *MapAnyItems) AddMapResultOption(
	isOverride bool,
	mapResults map[string]interface{},
) *MapAnyItems

func (*MapAnyItems) AddWithValidation

func (it *MapAnyItems) AddWithValidation(
	typeVerify reflect.Type,
	key string,
	anyInf interface{},
) error

func (*MapAnyItems) AllKeys

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

func (*MapAnyItems) AllKeysSorted

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

func (*MapAnyItems) AllValues

func (it *MapAnyItems) AllValues() []interface{}

func (*MapAnyItems) Clear

func (it *MapAnyItems) Clear()

func (*MapAnyItems) ClonePtr

func (it *MapAnyItems) ClonePtr() (*MapAnyItems, error)

func (*MapAnyItems) DeepClear

func (it *MapAnyItems) DeepClear()

func (*MapAnyItems) Deserialize

func (it *MapAnyItems) Deserialize(
	key string,
	toPointer interface{},
) error

func (*MapAnyItems) DeserializeMust

func (it *MapAnyItems) DeserializeMust(
	key string,
	toPointer interface{},
)

func (*MapAnyItems) Diff

func (it *MapAnyItems) Diff(
	isRegardlessType bool,
	rightMap *MapAnyItems,
) *MapAnyItems

func (*MapAnyItems) DiffJsonMessage

func (it *MapAnyItems) DiffJsonMessage(
	isRegardlessType bool,
	rightMap map[string]interface{},
) string

func (*MapAnyItems) DiffRaw

func (it *MapAnyItems) DiffRaw(
	isRegardlessType bool,
	rightMap map[string]interface{},
) map[string]interface{}

func (*MapAnyItems) Dispose

func (it *MapAnyItems) Dispose()

func (*MapAnyItems) Get

func (it *MapAnyItems) Get(
	key string,
) (any interface{}, has bool)

func (*MapAnyItems) GetFieldsMap

func (it *MapAnyItems) GetFieldsMap(
	key string,
) (
	fieldMap map[string]interface{},
	parsingErr error,
	isFound bool,
)

func (*MapAnyItems) GetItemRef

func (it *MapAnyItems) GetItemRef(
	key string,
	referenceOut interface{},
) error

func (*MapAnyItems) GetManyItemsRefs

func (it *MapAnyItems) GetManyItemsRefs(
	keyAnyItems ...corejson.KeyAny,
) error

func (*MapAnyItems) GetNewMapUsingKeys

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

func (*MapAnyItems) GetPagedCollection

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

func (*MapAnyItems) GetPagesSize

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

func (*MapAnyItems) GetSafeFieldsMap

func (it *MapAnyItems) GetSafeFieldsMap(
	key string,
) (
	fieldMap map[string]interface{},
	isFound bool,
)

GetSafeFieldsMap

Warning:

Swallows the parsing err if any

func (*MapAnyItems) GetSinglePageCollection

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

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

func (*MapAnyItems) GetUsingUnmarshallAt

func (it *MapAnyItems) GetUsingUnmarshallAt(
	key string,
	unmarshalRef interface{},
) error

func (*MapAnyItems) GetUsingUnmarshallManyAt

func (it *MapAnyItems) GetUsingUnmarshallManyAt(
	keyAnyItems ...corejson.KeyAny,
) error

func (*MapAnyItems) GetValue

func (it *MapAnyItems) GetValue(
	key string,
) (any interface{})

func (*MapAnyItems) HasAnyChanges

func (it *MapAnyItems) HasAnyChanges(
	isRegardlessType bool,
	rightMap map[string]interface{},
) bool

func (*MapAnyItems) HasAnyItem

func (it *MapAnyItems) HasAnyItem() bool

func (*MapAnyItems) HasKey

func (it *MapAnyItems) HasKey(key string) bool

func (*MapAnyItems) HashmapDiffUsingRaw

func (it *MapAnyItems) HashmapDiffUsingRaw(
	isRegardlessType bool,
	rightMap map[string]interface{},
) MapAnyItemDiff

func (*MapAnyItems) IsEmpty

func (it *MapAnyItems) IsEmpty() bool

func (*MapAnyItems) IsEqual

func (it *MapAnyItems) IsEqual(
	right *MapAnyItems,
) bool

func (*MapAnyItems) IsEqualRaw

func (it *MapAnyItems) IsEqualRaw(
	rightMappedItems map[string]interface{},
) bool

func (*MapAnyItems) IsRawEqual

func (it *MapAnyItems) IsRawEqual(
	isRegardlessType bool,
	rightMap map[string]interface{},
) bool

func (MapAnyItems) Json

func (it MapAnyItems) Json() corejson.Result

func (*MapAnyItems) JsonMapResults

func (it *MapAnyItems) JsonMapResults() (*corejson.MapResults, error)

func (*MapAnyItems) JsonModel

func (it *MapAnyItems) JsonModel() *corejson.MapResults

func (*MapAnyItems) JsonModelAny

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

func (*MapAnyItems) JsonParseSelfInject

func (it *MapAnyItems) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (MapAnyItems) JsonPtr

func (it MapAnyItems) JsonPtr() *corejson.Result

func (*MapAnyItems) JsonResultOfKey

func (it *MapAnyItems) JsonResultOfKey(
	key string,
) *corejson.Result

func (*MapAnyItems) JsonResultOfKeys

func (it *MapAnyItems) JsonResultOfKeys(
	keys ...string,
) *corejson.MapResults

func (*MapAnyItems) JsonResultsCollection

func (it *MapAnyItems) JsonResultsCollection() *corejson.ResultsCollection

func (*MapAnyItems) JsonResultsPtrCollection

func (it *MapAnyItems) JsonResultsPtrCollection() *corejson.ResultsPtrCollection

func (*MapAnyItems) JsonString

func (it *MapAnyItems) JsonString() (jsonString string, err error)

func (*MapAnyItems) JsonStringMust

func (it *MapAnyItems) JsonStringMust() string

func (*MapAnyItems) Length

func (it *MapAnyItems) Length() int

func (*MapAnyItems) LogShouldDiffMessage

func (it *MapAnyItems) LogShouldDiffMessage(
	isRegardlessType bool,
	title string,
	rightMap map[string]interface{},
) (diffMessage string)

func (*MapAnyItems) MapAnyItems

func (it *MapAnyItems) MapAnyItems() *MapAnyItems

func (*MapAnyItems) MapStringAnyDiff

func (it *MapAnyItems) MapStringAnyDiff() mapdiffinternal.MapStringAnyDiff

func (*MapAnyItems) ParseInjectUsingJson

func (it *MapAnyItems) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*MapAnyItems, error)

func (*MapAnyItems) ParseInjectUsingJsonMust

func (it *MapAnyItems) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *MapAnyItems

ParseInjectUsingJsonMust Panic if error

func (*MapAnyItems) RawMapStringAnyDiff

func (it *MapAnyItems) RawMapStringAnyDiff() mapdiffinternal.MapStringAnyDiff

func (*MapAnyItems) ReflectSetTo

func (it *MapAnyItems) ReflectSetTo(
	key string,
	toPointerOrBytes interface{},
) error

func (*MapAnyItems) ReflectSetToMust

func (it *MapAnyItems) ReflectSetToMust(
	key string,
	toPointerOrBytes interface{},
)

func (*MapAnyItems) Set

func (it *MapAnyItems) Set(
	key string,
	valInf interface{},
) (isNewlyAdded bool)

func (*MapAnyItems) ShouldDiffMessage

func (it *MapAnyItems) ShouldDiffMessage(
	isRegardlessType bool,
	title string,
	rightMap map[string]interface{},
) string

func (*MapAnyItems) String

func (it *MapAnyItems) String() string

func (*MapAnyItems) Strings

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

func (*MapAnyItems) ToStringsSliceOfDiffMap

func (it *MapAnyItems) ToStringsSliceOfDiffMap(
	diffMap map[string]interface{},
) (diffSlice []string)

type SimpleInOutConverter

type SimpleInOutConverter func(in interface{}, typeMust reflect.Type) *SimpleResult

type SimpleRequest

type SimpleRequest struct {
	Dynamic
	// contains filtered or unexported fields
}

func InvalidSimpleRequest

func InvalidSimpleRequest(
	message string,
) *SimpleRequest

func InvalidSimpleRequestNoMessage

func InvalidSimpleRequestNoMessage() *SimpleRequest

func NewSimpleRequest

func NewSimpleRequest(
	request interface{},
	isValid bool,
	message string,
) *SimpleRequest

func NewSimpleRequestValid

func NewSimpleRequestValid(
	request interface{},
) *SimpleRequest

func (*SimpleRequest) GetErrorOnTypeMismatch

func (receiver *SimpleRequest) GetErrorOnTypeMismatch(
	typeMatch reflect.Type,
	isIncludeInvalidMessage bool,
) error

func (*SimpleRequest) InvalidError

func (receiver *SimpleRequest) InvalidError() error

func (*SimpleRequest) IsPointer

func (receiver *SimpleRequest) IsPointer() bool

func (*SimpleRequest) IsReflectKind

func (receiver *SimpleRequest) IsReflectKind(checkingKind reflect.Kind) bool

func (*SimpleRequest) Message

func (receiver *SimpleRequest) Message() string

func (*SimpleRequest) Request

func (receiver *SimpleRequest) Request() interface{}

func (*SimpleRequest) Value

func (receiver *SimpleRequest) Value() interface{}

type SimpleRequestConverter

type SimpleRequestConverter func(request SimpleRequest) *SimpleResult

type SimpleResult

type SimpleResult struct {
	Dynamic
	Result  interface{}
	Message string
	// contains filtered or unexported fields
}

func InvalidSimpleResult

func InvalidSimpleResult(
	invalidMessage string,
) *SimpleResult

func InvalidSimpleResultNoMessage

func InvalidSimpleResultNoMessage() *SimpleResult

func NewSimpleResult

func NewSimpleResult(
	result interface{},
	isValid bool,
	invalidMessage string,
) *SimpleResult

func NewSimpleResultValid

func NewSimpleResultValid(
	result interface{},
) *SimpleResult

func (*SimpleResult) Clone

func (it *SimpleResult) Clone() SimpleResult

func (*SimpleResult) ClonePtr

func (it *SimpleResult) ClonePtr() *SimpleResult

func (*SimpleResult) GetErrorOnTypeMismatch

func (it *SimpleResult) GetErrorOnTypeMismatch(
	typeMatch reflect.Type,
	isIncludeInvalidMessage bool,
) error

func (*SimpleResult) InvalidError

func (it *SimpleResult) InvalidError() error

type TypeStatus

type TypeStatus struct {
	IsSame                                bool
	IsLeftUnknownNull, IsRightUnknownNull bool
	IsRightPointer, IsLeftPointer         bool
	Left, Right                           reflect.Type
	// contains filtered or unexported fields
}

func TypeSameStatus

func TypeSameStatus(
	left, right interface{},
) TypeStatus

func (TypeStatus) IsAnyPointer

func (it TypeStatus) IsAnyPointer() bool

func (TypeStatus) IsBothPointer

func (it TypeStatus) IsBothPointer() bool

func (*TypeStatus) IsEqual

func (it *TypeStatus) IsEqual(next *TypeStatus) bool

func (*TypeStatus) IsInvalid

func (it *TypeStatus) IsInvalid() bool

func (TypeStatus) IsNotEqualTypes

func (it TypeStatus) IsNotEqualTypes() bool

func (TypeStatus) IsNotSame

func (it TypeStatus) IsNotSame() bool

func (TypeStatus) IsSameRegardlessPointer

func (it TypeStatus) IsSameRegardlessPointer() bool

func (*TypeStatus) IsValid

func (it *TypeStatus) IsValid() bool

func (TypeStatus) LeftFullName

func (it TypeStatus) LeftFullName() string

func (TypeStatus) LeftName

func (it TypeStatus) LeftName() string

func (TypeStatus) MustBeSame

func (it TypeStatus) MustBeSame()

func (TypeStatus) NonPointerLeft

func (it TypeStatus) NonPointerLeft() reflect.Type

func (TypeStatus) NonPointerRight

func (it TypeStatus) NonPointerRight() reflect.Type

func (TypeStatus) NotEqualSrcDestinationErr

func (it TypeStatus) NotEqualSrcDestinationErr() error

func (TypeStatus) NotEqualSrcDestinationMessage

func (it TypeStatus) NotEqualSrcDestinationMessage() string

func (TypeStatus) NotMatchErr

func (it TypeStatus) NotMatchErr(
	leftName,
	rightName string,
) error

func (TypeStatus) NotMatchMessage

func (it TypeStatus) NotMatchMessage(
	leftName,
	rightName string,
) string

func (TypeStatus) RightFullName

func (it TypeStatus) RightFullName() string

func (TypeStatus) RightName

func (it TypeStatus) RightName() string

func (TypeStatus) SrcDestinationMustBeSame

func (it TypeStatus) SrcDestinationMustBeSame()

func (TypeStatus) ValidationError added in v1.5.0

func (it TypeStatus) ValidationError() error

type TypeToTypeConverterFunc added in v1.4.3

type TypeToTypeConverterFunc func(in interface{}) (output interface{}, err error)

type TypeToTypeConverterMustFunc added in v1.4.3

type TypeToTypeConverterMustFunc func(in interface{}) (output interface{})

type TypeToTypeConverterWithOptionsFunc added in v1.4.3

type TypeToTypeConverterWithOptionsFunc func(in interface{}, options interface{}) (output interface{}, err error)

type TypeToTypeConverterWithOptionsMustFunc added in v1.4.3

type TypeToTypeConverterWithOptionsMustFunc func(in interface{}, options interface{}) (output interface{})

type ValueStatus

type ValueStatus struct {
	IsValid bool
	Message string
	Index   int
	Value   interface{}
}

func InvalidValueStatus

func InvalidValueStatus(message string) *ValueStatus

func InvalidValueStatusNoMessage

func InvalidValueStatusNoMessage() *ValueStatus

Jump to

Keyboard shortcuts

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