inter

package
v0.2.7-0...-efca372 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 3 Imported by: 0

README

Description

This module is used to place code that needs to be exported to go code access, but cannot be exported to go mobile sdk access.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstIndexOf

func FirstIndexOf[T any](arr []T, matcher func(elem T) bool) int

FirstIndexOf 该方法的参数无法打包到 sdk, 因此从对象方法中移出为公共方法 return -1 if not found

func IsASCII

func IsASCII(str string) bool

func IsHexString

func IsHexString(str string) (valid bool, length int)

IsHexString

func KeysOf

func KeysOf[K comparable, V any](m map[K]V) []K

Keys 该方法的返回值无法打包到 sdk, 因此从对象方法中移出为公共方法

func LastIndexOf

func LastIndexOf[T any](arr []T, matcher func(elem T) bool) int

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]) Append

func (a *AnyArray[T]) Append(value T)

func (AnyArray[T]) Count

func (a AnyArray[T]) Count() int

func (AnyArray[T]) JsonString

func (a AnyArray[T]) JsonString() string

func (AnyArray[T]) MarshalJSON

func (a AnyArray[T]) MarshalJSON() ([]byte, error)

func (*AnyArray[T]) Remove

func (a *AnyArray[T]) Remove(index int) T

func (*AnyArray[T]) SetValue

func (a *AnyArray[T]) SetValue(value T, index int)

func (*AnyArray[T]) UnmarshalJSON

func (a *AnyArray[T]) UnmarshalJSON(data []byte) error

func (AnyArray[T]) ValueAt

func (a AnyArray[T]) ValueAt(index int) T

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]) Contains

func (a AnyMap[K, V]) Contains(key K) bool

func (AnyMap[K, V]) Count

func (a AnyMap[K, V]) Count() int

func (AnyMap[K, V]) HasKey deprecated

func (a AnyMap[K, V]) HasKey(key K) bool

Deprecated: Use Contains(key) instead.

func (AnyMap[K, V]) JsonString

func (a AnyMap[K, V]) JsonString() string

func (AnyMap[K, V]) MarshalJSON

func (a AnyMap[K, V]) MarshalJSON() ([]byte, error)

func (*AnyMap[K, V]) Remove

func (a *AnyMap[K, V]) Remove(key K) V

func (*AnyMap[K, V]) SetValue

func (a *AnyMap[K, V]) SetValue(value V, key K)

func (*AnyMap[K, V]) UnmarshalJSON

func (a *AnyMap[K, V]) UnmarshalJSON(data []byte) error

func (AnyMap[K, V]) ValueOf

func (a AnyMap[K, V]) ValueOf(key K) V

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

Jump to

Keyboard shortcuts

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