Documentation
¶
Index ¶
- func AnyToReflectVal(any interface{}) reflect.Value
- func LengthOfReflect(reflectVal reflect.Value) int
- func MapKeysStringSlice(reflectVal reflect.Value) ([]string, error)
- func MapKeysStringSliceAny(any interface{}) ([]string, error)
- func MapKeysStringSliceAnyMust(any interface{}) []string
- func MapKeysStringSliceAnySorted(any interface{}) ([]string, error)
- func MapKeysStringSliceAnySortedMust(any interface{}) []string
- func SliceItemsAsStrings(reflectVal reflect.Value) ([]string, error)
- func SliceItemsAsStringsAny(any interface{}) ([]string, error)
- func SliceItemsAsStringsAnyMust(any interface{}) []string
- func SliceItemsProcessorAsStrings(reflectVal reflect.Value, ...) ([]string, error)
- func SliceItemsSimpleProcessorAsStrings(reflectVal reflect.Value, isSkipEmpty bool, ...) ([]string, error)
- type Collection
- func (receiver *Collection) Add(dynamic Dynamic) *Collection
- func (receiver *Collection) AddAny(anyItem interface{}, isValid bool) *Collection
- func (receiver *Collection) AddAnyMany(anyItems ...interface{}) *Collection
- func (receiver *Collection) AddAnyNonNull(anyItem interface{}, isValid bool) *Collection
- func (receiver *Collection) AddManyPtr(dynamicItems ...*Dynamic) *Collection
- func (receiver *Collection) AddNonEmpty(dynamic *Dynamic) *Collection
- func (receiver *Collection) AddPtr(dynamic *Dynamic) *Collection
- func (receiver *Collection) At(index int) *Dynamic
- func (receiver *Collection) Count() int
- func (receiver *Collection) HasAnyItem() bool
- func (receiver *Collection) HasIndex(index int) bool
- func (receiver *Collection) IsEmpty() bool
- func (receiver *Collection) Items() *[]*Dynamic
- func (receiver *Collection) LastIndex() int
- func (receiver *Collection) Length() int
- func (receiver *Collection) ListStrings() []string
- func (receiver *Collection) ListStringsPtr() *[]string
- func (receiver *Collection) MarshalJSON() ([]byte, error)
- func (receiver *Collection) RemoveAt(index int) (isSuccess bool)
- func (receiver *Collection) String() string
- func (receiver *Collection) StringJson() (jsonString string, err error)
- func (receiver *Collection) StringJsonMust() string
- func (receiver *Collection) UnmarshalJSON(data []byte) error
- type Dynamic
- func (receiver *Dynamic) Clone() *Dynamic
- func (receiver *Dynamic) ConvertUsingFunc(converter SimpleInOutConverter, expectedType reflect.Type) *SimpleResult
- func (receiver *Dynamic) Data() interface{}
- func (receiver *Dynamic) Float64() (val float64, err error)
- func (receiver *Dynamic) IntDefault(defaultInt int) (val int, isSuccess bool)
- func (receiver *Dynamic) IsFunc() bool
- func (receiver *Dynamic) IsInvalid() bool
- func (receiver *Dynamic) IsMap() bool
- func (receiver *Dynamic) IsNull() bool
- func (receiver *Dynamic) IsNumber() bool
- func (receiver *Dynamic) IsPointer() bool
- func (receiver *Dynamic) IsPrimitive() bool
- func (receiver *Dynamic) IsReflectKind(checkingKind reflect.Kind) bool
- func (receiver *Dynamic) IsReflectTypeOf(typeRequest reflect.Type) bool
- func (receiver *Dynamic) IsSliceOrArray() bool
- func (receiver *Dynamic) IsSliceOrArrayOrMap() bool
- func (receiver *Dynamic) IsStruct() bool
- func (receiver *Dynamic) IsStructStringNullOrEmpty() bool
- func (receiver *Dynamic) IsStructStringNullOrEmptyOrWhitespace() bool
- func (receiver *Dynamic) IsValid() bool
- func (receiver *Dynamic) IsValueType() bool
- func (receiver *Dynamic) JsonBytes() (jsonBytesPtr []byte, err error)
- func (receiver *Dynamic) JsonBytesPtr() (jsonBytesPtr *[]byte, err error)
- func (receiver *Dynamic) Length() int
- func (receiver *Dynamic) MapToKeyVal() (*KeyValCollection, error)
- func (receiver *Dynamic) MarshalJSON() ([]byte, error)
- func (receiver *Dynamic) ReflectKind() reflect.Kind
- func (receiver *Dynamic) ReflectType() reflect.Type
- func (receiver *Dynamic) ReflectTypeName() string
- func (receiver *Dynamic) ReflectValue() *reflect.Value
- func (receiver *Dynamic) String() string
- func (receiver *Dynamic) StringJson() (jsonString string, err error)
- func (receiver *Dynamic) StringJsonMust() string
- func (receiver *Dynamic) StructString() string
- func (receiver *Dynamic) StructStringPtr() *string
- func (receiver *Dynamic) UnmarshalJSON(data []byte) error
- func (receiver *Dynamic) Value() interface{}
- type DynamicStatus
- type KeyVal
- type KeyValCollection
- func (receiver *KeyValCollection) AddMany(keyValues ...*KeyVal) *KeyValCollection
- func (receiver *KeyValCollection) AddPtr(keyVal *KeyVal) *KeyValCollection
- func (receiver *KeyValCollection) HasAnyItem() bool
- func (receiver *KeyValCollection) IsEmpty() bool
- func (receiver *KeyValCollection) Items() *[]*KeyVal
- func (receiver *KeyValCollection) Length() int
- func (receiver *KeyValCollection) String() string
- func (receiver *KeyValCollection) StringJson() (jsonString string, err error)
- func (receiver *KeyValCollection) StringJsonMust() string
- type SimpleInOutConverter
- type SimpleRequest
- func (receiver *SimpleRequest) GetErrorOnTypeMismatch(typeMatch reflect.Type, isIncludeInvalidMessage bool) error
- func (receiver *SimpleRequest) InvalidError() error
- func (receiver *SimpleRequest) IsPointer() bool
- func (receiver *SimpleRequest) IsReflectKind(checkingKind reflect.Kind) bool
- func (receiver *SimpleRequest) Message() string
- func (receiver *SimpleRequest) Request() interface{}
- func (receiver *SimpleRequest) Value() interface{}
- type SimpleRequestConverter
- type SimpleResult
- type ValueStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToReflectVal ¶ added in v0.6.9
func LengthOfReflect ¶
func MapKeysStringSlice ¶ added in v0.6.9
func MapKeysStringSliceAny ¶ added in v0.6.9
func MapKeysStringSliceAnyMust ¶ added in v0.6.9
func MapKeysStringSliceAnyMust(any interface{}) []string
func MapKeysStringSliceAnySorted ¶ added in v0.6.9
func MapKeysStringSliceAnySortedMust ¶ added in v0.6.9
func MapKeysStringSliceAnySortedMust(any interface{}) []string
func SliceItemsAsStrings ¶ added in v0.6.9
func SliceItemsAsStringsAny ¶ added in v0.6.9
func SliceItemsAsStringsAnyMust ¶ added in v0.6.9
func SliceItemsAsStringsAnyMust(any interface{}) []string
func SliceItemsProcessorAsStrings ¶ added in v0.6.9
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func EmptyDynamicCollection ¶
func EmptyDynamicCollection() *Collection
func NewDynamicCollection ¶
func NewDynamicCollection(capacity int) *Collection
func (*Collection) Add ¶
func (receiver *Collection) Add(dynamic Dynamic) *Collection
func (*Collection) AddAny ¶
func (receiver *Collection) AddAny(anyItem interface{}, isValid bool) *Collection
func (*Collection) AddAnyMany ¶
func (receiver *Collection) AddAnyMany(anyItems ...interface{}) *Collection
func (*Collection) AddAnyNonNull ¶
func (receiver *Collection) AddAnyNonNull(anyItem interface{}, isValid bool) *Collection
func (*Collection) AddManyPtr ¶
func (receiver *Collection) AddManyPtr(dynamicItems ...*Dynamic) *Collection
func (*Collection) AddNonEmpty ¶
func (receiver *Collection) AddNonEmpty(dynamic *Dynamic) *Collection
func (*Collection) AddPtr ¶
func (receiver *Collection) AddPtr(dynamic *Dynamic) *Collection
func (*Collection) At ¶
func (receiver *Collection) At(index int) *Dynamic
func (*Collection) Count ¶
func (receiver *Collection) Count() int
func (*Collection) HasAnyItem ¶
func (receiver *Collection) HasAnyItem() bool
func (*Collection) HasIndex ¶
func (receiver *Collection) HasIndex(index int) bool
func (*Collection) IsEmpty ¶
func (receiver *Collection) IsEmpty() bool
func (*Collection) Items ¶
func (receiver *Collection) Items() *[]*Dynamic
func (*Collection) LastIndex ¶
func (receiver *Collection) LastIndex() int
func (*Collection) Length ¶
func (receiver *Collection) Length() int
func (*Collection) ListStrings ¶
func (receiver *Collection) ListStrings() []string
func (*Collection) ListStringsPtr ¶
func (receiver *Collection) ListStringsPtr() *[]string
func (*Collection) MarshalJSON ¶
func (receiver *Collection) MarshalJSON() ([]byte, error)
func (*Collection) RemoveAt ¶
func (receiver *Collection) RemoveAt(index int) (isSuccess bool)
func (*Collection) String ¶
func (receiver *Collection) String() string
func (*Collection) StringJson ¶
func (receiver *Collection) StringJson() (jsonString string, err error)
func (*Collection) StringJsonMust ¶
func (receiver *Collection) StringJsonMust() string
func (*Collection) UnmarshalJSON ¶
func (receiver *Collection) UnmarshalJSON(data []byte) error
type Dynamic ¶
type Dynamic struct {
// contains filtered or unexported fields
}
func InvalidDynamic ¶ added in v0.5.1
func InvalidDynamic() Dynamic
func InvalidDynamicPtr ¶ added in v0.5.1
func InvalidDynamicPtr() *Dynamic
func NewDynamic ¶
func NewDynamicPtr ¶
func NewDynamicValid ¶ added in v0.6.5
func NewDynamicValid( data interface{}, ) Dynamic
func (*Dynamic) ConvertUsingFunc ¶
func (receiver *Dynamic) ConvertUsingFunc( converter SimpleInOutConverter, expectedType reflect.Type, ) *SimpleResult
func (*Dynamic) IntDefault ¶
func (*Dynamic) IsPrimitive ¶
func (*Dynamic) IsReflectKind ¶
func (*Dynamic) IsReflectTypeOf ¶
func (*Dynamic) IsSliceOrArray ¶
func (*Dynamic) IsSliceOrArrayOrMap ¶ added in v0.4.6
func (*Dynamic) IsStructStringNullOrEmpty ¶
func (*Dynamic) IsStructStringNullOrEmptyOrWhitespace ¶
func (*Dynamic) IsValueType ¶
func (*Dynamic) JsonBytesPtr ¶
JsonBytesPtr returns empty string on nil. no error on nil.
func (*Dynamic) Length ¶
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) MapToKeyVal ¶
func (receiver *Dynamic) MapToKeyVal() (*KeyValCollection, error)
func (*Dynamic) MarshalJSON ¶
func (*Dynamic) ReflectKind ¶
func (*Dynamic) ReflectType ¶
func (*Dynamic) ReflectTypeName ¶
func (*Dynamic) ReflectValue ¶
func (*Dynamic) StringJson ¶
func (*Dynamic) StringJsonMust ¶
func (*Dynamic) StructString ¶
func (*Dynamic) StructStringPtr ¶
func (*Dynamic) UnmarshalJSON ¶
type DynamicStatus ¶ added in v0.4.7
func InvalidDynamicStatus ¶ added in v0.5.1
func InvalidDynamicStatus(message string) *DynamicStatus
func InvalidDynamicStatusNoMessage ¶ added in v0.5.1
func InvalidDynamicStatusNoMessage() *DynamicStatus
func (*DynamicStatus) Clone ¶ added in v0.5.1
func (receiver *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.
type KeyVal ¶
type KeyVal struct { Key interface{} Value interface{} }
func (*KeyVal) KeyDynamic ¶
func (*KeyVal) ValueDynamic ¶
type KeyValCollection ¶
type KeyValCollection struct {
// contains filtered or unexported fields
}
func EmptyKeyValCollection ¶
func EmptyKeyValCollection() *KeyValCollection
func MapAsKeyValSlice ¶
func MapAsKeyValSlice(reflectVal reflect.Value) (*KeyValCollection, error)
func NewKeyValCollection ¶
func NewKeyValCollection(capacity int) *KeyValCollection
func (*KeyValCollection) AddMany ¶
func (receiver *KeyValCollection) AddMany( keyValues ...*KeyVal, ) *KeyValCollection
func (*KeyValCollection) AddPtr ¶
func (receiver *KeyValCollection) AddPtr( keyVal *KeyVal, ) *KeyValCollection
func (*KeyValCollection) HasAnyItem ¶
func (receiver *KeyValCollection) HasAnyItem() bool
func (*KeyValCollection) IsEmpty ¶
func (receiver *KeyValCollection) IsEmpty() bool
func (*KeyValCollection) Items ¶
func (receiver *KeyValCollection) Items() *[]*KeyVal
func (*KeyValCollection) Length ¶
func (receiver *KeyValCollection) Length() int
func (*KeyValCollection) String ¶
func (receiver *KeyValCollection) String() string
func (*KeyValCollection) StringJson ¶
func (receiver *KeyValCollection) StringJson() (jsonString string, err error)
func (*KeyValCollection) StringJsonMust ¶
func (receiver *KeyValCollection) StringJsonMust() 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 ¶ added in v0.5.1
func InvalidSimpleRequest( message string, ) *SimpleRequest
func InvalidSimpleRequestNoMessage ¶ added in v0.5.1
func InvalidSimpleRequestNoMessage() *SimpleRequest
func NewSimpleRequest ¶
func NewSimpleRequest( request interface{}, isValid bool, message string, ) *SimpleRequest
func NewSimpleRequestValid ¶ added in v0.6.5
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 ¶ added in v0.5.1
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 ¶ added in v0.5.1
func InvalidSimpleResult( invalidMessage string, ) *SimpleResult
func InvalidSimpleResultNoMessage ¶ added in v0.5.1
func InvalidSimpleResultNoMessage() *SimpleResult
func NewSimpleResult ¶
func NewSimpleResult( result interface{}, isValid bool, invalidMessage string, ) *SimpleResult
func NewSimpleResultValid ¶ added in v0.6.5
func NewSimpleResultValid( result interface{}, ) *SimpleResult
func (*SimpleResult) Clone ¶ added in v0.5.1
func (receiver *SimpleResult) Clone() *SimpleResult
func (*SimpleResult) GetErrorOnTypeMismatch ¶
func (receiver *SimpleResult) GetErrorOnTypeMismatch( typeMatch reflect.Type, isIncludeInvalidMessage bool, ) error
func (*SimpleResult) InvalidError ¶
func (receiver *SimpleResult) InvalidError() error
type ValueStatus ¶ added in v0.4.7
func InvalidValueStatus ¶ added in v0.5.1
func InvalidValueStatus(message string) *ValueStatus
func InvalidValueStatusNoMessage ¶ added in v0.5.1
func InvalidValueStatusNoMessage() *ValueStatus
Source Files
¶
- AnyToReflectVal.go
- Collection.go
- Dynamic.go
- DynamicStatus.go
- KeyVal.go
- KeyValCollection.go
- LengthOfReflect.go
- MapAsKeyValSlice.go
- MapKeysStringSlice.go
- MapKeysStringSliceAny.go
- MapKeysStringSliceAnyMust.go
- MapKeysStringSliceAnySorted.go
- MapKeysStringSliceAnySortedMust.go
- SimpleRequest.go
- SimpleResult.go
- SliceItemsAsStrings.go
- SliceItemsAsStringsAny.go
- SliceItemsAsStringsAnyMust.go
- SliceItemsProcessorAsStrings.go
- SliceItemsSimpleProcessorAsStrings.go
- ValueStatus.go
- funcs.go
Click to show internal directories.
Click to hide internal directories.