Documentation ¶
Index ¶
- func Authentication(w http.ResponseWriter, r *http.Request)
- func Backup(w http.ResponseWriter, r *http.Request)
- func Broadcast(w http.ResponseWriter, r *http.Request)
- func Deposit(w http.ResponseWriter, r *http.Request)
- func GetActions(w http.ResponseWriter, r *http.Request)
- func GetBalance(w http.ResponseWriter, r *http.Request)
- func GetLuckymoney(w http.ResponseWriter, r *http.Request)
- func NewAuthenticatorOnce()
- func Subscribers(w http.ResponseWriter, r *http.Request)
- type AuthRequest
- type AuthRespone
- type Authenticator
- type BackupRequest
- type BroadcastRequest
- type BroadcastRespone
- type Ciphertext
- type DepositRequest
- type DepositRespone
- type GetActionsRequest
- type GetActionsRespone
- type GetBalanceRequest
- type GetBalanceRespone
- type GetLuckymoneyRequest
- type GetLuckymoneyRespone
- type GetSubscribersRequest
- type Luckymoney
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
验证器
func (*Authenticator) Auth ¶
func (a *Authenticator) Auth(ip string, data []byte) (string, bool)
验证身份
func (*Authenticator) Decode ¶
func (a *Authenticator) Decode(data []byte) (string, []byte, bool)
解码消息
type BroadcastRequest ¶
type BroadcastRequest struct { Message string `json:"message"` // 消息内容 Tonce int64 `json:"tonce"` // 时间戳 }
广播消息请求
type Ciphertext ¶
type Ciphertext struct { ACK bool `json:"ack"` Session string `json:"session,omitempty"` Data string `json:"data"` Checksum uint32 `json:"checksum"` }
密文消息
type DepositRequest ¶
type DepositRequest struct { UserID int64 `json:"user_id"` // 用户ID Amount *big.Float `json:"amount"` // 充值金额 Tonce int64 `json:"tonce"` // 时间戳 }
充值请求
type DepositRespone ¶
type DepositRespone struct { Amount *big.Float `json:"amount"` // 可用余额 Locked *big.Float `json:"locked"` // 锁定金额 }
充值响应
type GetActionsRequest ¶
type GetActionsRequest struct { UserID int64 `json:"user_id"` // 用户ID Offset uint `json:"offset"` // 偏移量 Limit uint `json:"limit"` // 返回数量 Tonce int64 `json:"tonce"` // 时间戳 }
获取动作请求
type GetActionsRespone ¶
type GetActionsRespone struct { Sum int `json:"sum"` // 动作总量 Count int `json:"count"` // 返回数量 Actions []*models.Version `json:"actions"` // 动作列表 }
获取动作响应
type GetBalanceRequest ¶
type GetBalanceRequest struct { UserID int64 `json:"user_id"` // 用户ID Tonce int64 `json:"tonce"` // 时间戳 }
获取余额请求
type GetBalanceRespone ¶
type GetBalanceRespone struct { Amount *big.Float `json:"amount"` // 可用余额 Locked *big.Float `json:"locked"` // 锁定金额 }
获取余额响应
type GetLuckymoneyRequest ¶
type GetLuckymoneyRequest struct { UserID int64 `json:"user_id"` // 用户ID Offset uint `json:"offset"` // 偏移量 Limit uint `json:"limit"` // 返回数量 Tonce int64 `json:"tonce"` // 时间戳 }
获取红包请求
type GetLuckymoneyRespone ¶
type GetLuckymoneyRespone struct { Sum int `json:"sum"` // 动作总量 Count int `json:"count"` // 返回数量 Result []*Luckymoney `json:"result"` // 红包列表 }
获取红包响应
type GetSubscribersRequest ¶
type GetSubscribersRequest struct {
Tonce int64 `json:"tonce"` // 时间戳
}
获取订户请求
Click to show internal directories.
Click to hide internal directories.