Documentation ¶
Index ¶
- Constants
- func GetRandom(n int, isNO bool) string
- func GetRandomInt(max *big.Int) (int, error)
- func UnInit()
- func WebError(err error, webErr string) string
- type AuthUser
- func (p *AuthUser) GetQrcode(authID string) (string, error)
- func (p *AuthUser) HandleCrypto(action, content string) (ret string, retErr error)
- func (p *AuthUser) Init(authID, recoverID string, privateKey *ecdsa.PrivateKey) (string, string, error)
- func (p *AuthUser) Reset(authID, pushID, recoverID, web3Public string) (*AuthUser, error)
- type Response
- type Server
- func (p *Server) FatalCheck(err error)
- func (p *Server) GetCache(key string, bDelete bool, beforeDelleteFunc func(v interface{}) bool) interface{}
- func (p *Server) GetConf(key string) string
- func (p *Server) GetVar(key string, bDelete bool, beforeDelleteFunc func(v interface{}) bool) interface{}
- func (p *Server) SetCache(key string, val interface{}, bForce bool) error
- func (p *Server) SetCacheByTime(key string, val interface{}, bForce bool, timeout time.Duration, ...) error
- func (p *Server) SetConf(key, val string)
- func (p *Server) SetVar(key string, val interface{}, bForce bool) error
Constants ¶
const (
C_date_time = "2006-01-02 15:04:05"
)
global const
Variables ¶
This section is empty.
Functions ¶
func GetRandomInt ¶
===================================help function=====================================
Types ¶
type AuthUser ¶
type AuthUser struct { ActiveTime time.Time Web3Public *ecdsa.PublicKey SelfPrivate *ecdsa.PrivateKey }
func GetAuthUser ¶
func (*AuthUser) HandleCrypto ¶
type Response ¶
type Response struct { Data interface{} Error string }
func Auth ¶
@request authID: wallet address @request code: code input for dynamic authorization @request kind: kind need verify for dynamic authorization @request params: params need verify for dynamic authorization @response for email verify qrcode for dynamic authorization verify @response for dynamic authorization content encrypted or decrypted by backend key
func Load ¶
@request authID wallet address @response backendPublic backend public key @response web3Public wallet account public key
func Recover ¶
Post: /api/user/recover @request authID: wallet address @request pushID: push channel used to recover the backend (email phone number, etc.) @response successed or error
func Register ¶
@request authID: wallet address @request recoverID: push channel used to recover the backend (email phone number, etc.) @response recoverID: recovery ID encrypted by backend key @response qrcode: QR code for Google Authenticator scanning to add account @response backendKey: encrypted by backend public key
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) FatalCheck ¶
func (*Server) GetCache ¶
func (p *Server) GetCache(key string, bDelete bool, beforeDelleteFunc func(v interface{}) bool) interface{}
delete: beforeDelleteFunc return true
func (*Server) GetVar ¶
func (p *Server) GetVar(key string, bDelete bool, beforeDelleteFunc func(v interface{}) bool) interface{}
delete: beforeDelleteFunc return true