Documentation ¶
Index ¶
- func FatalCheck(err error)
- func GetCache(key string, bDelete bool, beforeDelleteFunc func(v interface{}) bool) interface{}
- func LogDebugf(format string, datas ...interface{})
- func LogDebugln(datas ...interface{})
- func SetCache(key string, val interface{}, bForce bool) error
- func SetCacheByTime(key string, val interface{}, bForce bool, timeout time.Duration, ...) error
- func Str(data any) string
- func Web2DataInit(wd2 *pkg.Web2Data, user *User, selfKey []byte) *pkg.Web2Data
- func Web2DecryptWebAuthnKey(user *User, selfKey []byte) (string, error)
- func Web2EncryptWeb2Data(wd2 *pkg.Web2Data) (string, error)
- func WebError(err error, webErr string) string
- type Response
- func WasmAuthorizeCode(datas ...string) *Response
- func WasmHandle(datas ...string) *Response
- func WasmInit(datas ...string) *Response
- func WasmPublic(datas ...string) *Response
- func WasmRegister(datas ...string) *Response
- func WasmStatus(datas ...string) *Response
- func WasmVerify(datas ...string) *Response
- type SelfData
- type User
- func (p *User) GetTOTPKey(selfPrivate *ecdsa.PrivateKey) (string, error)
- func (p *User) HandleAssociatedVerify(action, relateTimes string, selfPrivate *ecdsa.PrivateKey) (any, error)
- func (p *User) InitTOTPKey(selfPrivate *ecdsa.PrivateKey) (string, []byte, error)
- func (p *User) InitWeb3User(recoverID string, wd2 *pkg.Web2Data) (*Web3User, string, *ecdsa.PrivateKey, error)
- func (p *User) Load() ([]byte, *ecdsa.PrivateKey, error)
- func (p *User) PackSigAndMerkleLeaves(action string, selfPrivate *ecdsa.PrivateKey) (any, error)
- func (p *User) Register(recoverID string) (*Web3User, error)
- func (p *User) ResetSelfKey(kind, random, web2Key string, selfPrivate *ecdsa.PrivateKey) (any, error)
- func (p *User) ResetTOTPKey(recoverID, encryptedRecoverID string, selfPrivate *ecdsa.PrivateKey) (any, error)
- func (p *User) VerifyTOTP(code string) error
- type Web3User
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FatalCheck ¶
func FatalCheck(err error)
func LogDebugln ¶
func LogDebugln(datas ...interface{})
func SetCacheByTime ¶
func Web2DecryptWebAuthnKey ¶
Types ¶
type Response ¶
type Response struct { Data interface{} Error string }
func WasmAuthorizeCode ¶
@request userID: unique user ID @request authorizedID: ID used for dynamic authorization, such as email address, mobile phone number, etc @response successed or error
func WasmHandle ¶
@request userID: wallet address @request params: Optional, specific business parameters for the next step of the process after dynamic authorization is successful @response business data or error
func WasmInit ¶
@request userID unique user ID @request selfPass selfPass input by user @request web2NetPublic we2 network publicKey @request web2Datas web2 response params @response successed or error
func WasmRegister ¶
@request userID unique user ID @request recoverID: Unique ID for social recovery, such as email address, mobile phone number, etc @response web3User or error
func WasmStatus ¶ added in v1.0.1
@request userID unique user ID @response user status or error
func WasmVerify ¶
@request userID: wallet address @request kind: kind need verify for dynamic authorization, such as TOTP, email, etc. @request code: Verification code for dynamic authorization, such as TOTP, email, mobile phone verification codes, etc @request params: Optional, specific business parameters for the next step of the process after dynamic authorization is successful @response business data or error
type User ¶
type User struct { SelfData *SelfData SelfKey3 string RecoverID3 string SelfPrivate3 string // init by NewUser Web2PublicKey *ecdsa.PublicKey Web3PublicKey *ecdsa.PublicKey RelateTimes int RelateVerifyParams [][]byte }
func (*User) GetTOTPKey ¶
func (p *User) GetTOTPKey(selfPrivate *ecdsa.PrivateKey) (string, error)