Documentation ¶
Index ¶
- func FirstIndexOf[T any](arr []T, matcher func(elem T) bool) int
- func IsASCII(str string) bool
- func IsHexString(str string) (valid bool, length int)
- func KeysOf[K comparable, V any](m map[K]V) []K
- func LastIndexOf[T any](arr []T, matcher func(elem T) bool) int
- type AnyArray
- func (a *AnyArray[T]) Append(value T)
- func (a AnyArray[T]) Count() int
- func (a AnyArray[T]) JsonString() string
- func (a AnyArray[T]) MarshalJSON() ([]byte, error)
- func (a *AnyArray[T]) Remove(index int) T
- func (a *AnyArray[T]) SetValue(value T, index int)
- func (a *AnyArray[T]) UnmarshalJSON(data []byte) error
- func (a AnyArray[T]) ValueAt(index int) T
- type AnyMap
- func (a AnyMap[K, V]) Contains(key K) bool
- func (a AnyMap[K, V]) Count() int
- func (a AnyMap[K, V]) HasKey(key K) booldeprecated
- func (a AnyMap[K, V]) JsonString() string
- func (a AnyMap[K, V]) MarshalJSON() ([]byte, error)
- func (a *AnyMap[K, V]) Remove(key K) V
- func (a *AnyMap[K, V]) SetValue(value V, key K)
- func (a *AnyMap[K, V]) UnmarshalJSON(data []byte) error
- func (a AnyMap[K, V]) ValueOf(key K) V
- type SdkPageable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstIndexOf ¶
FirstIndexOf 该方法的参数无法打包到 sdk, 因此从对象方法中移出为公共方法 return -1 if not found
func KeysOf ¶
func KeysOf[K comparable, V any](m map[K]V) []K
Keys 该方法的返回值无法打包到 sdk, 因此从对象方法中移出为公共方法
func LastIndexOf ¶
LastIndexOf 该方法的参数无法打包到 sdk, 因此从对象方法中移出为公共方法 return -1 if not found
Types ¶
type AnyArray ¶
type AnyArray[T any] []T
AnyArray ### Usage example for SDK
type StringArray struct { AnyArray[string] } func NewStringArray() *StringArray { return &StringArray{[]string{}} }
### Usage Done
func (AnyArray[T]) JsonString ¶
func (AnyArray[T]) MarshalJSON ¶
func (*AnyArray[T]) UnmarshalJSON ¶
type AnyMap ¶
type AnyMap[K comparable, V any] map[K]V
AnyMap ### Usage example for SDK
type StringMap struct { AnyMap[string, string] } func NewStringMap() *StringMap { return &StringMap{map[string]string{}} }
### Usage Done
func (AnyMap[K, V]) JsonString ¶
func (AnyMap[K, V]) MarshalJSON ¶
func (*AnyMap[K, V]) UnmarshalJSON ¶
type SdkPageable ¶
type SdkPageable[T any] struct { TotalCount_ int `json:"totalCount"` CurrentCount_ int `json:"currentCount"` CurrentCursor_ string `json:"currentCursor"` HasNextPage_ bool `json:"hasNextPage"` Items []T `json:"items"` }
`SdkPageable` implemented wallet-SDK/base's interface `Jsonable` If you new class `Xxx` extends it, you should implement `NewXxxWithJsonString` by your self.
func (*SdkPageable[T]) CurrentCount ¶
func (p *SdkPageable[T]) CurrentCount() int
func (*SdkPageable[T]) CurrentCursor ¶
func (p *SdkPageable[T]) CurrentCursor() string
func (*SdkPageable[T]) HasNextPage ¶
func (p *SdkPageable[T]) HasNextPage() bool
func (*SdkPageable[T]) ItemAt ¶
func (p *SdkPageable[T]) ItemAt(index int) T
It's will crash when index out of range
func (*SdkPageable[T]) JsonString ¶
func (p *SdkPageable[T]) JsonString() string
func (*SdkPageable[T]) TotalCount ¶
func (p *SdkPageable[T]) TotalCount() int
Click to show internal directories.
Click to hide internal directories.