UDPWallet

package
v0.0.0-...-65b7337 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePayBill

func CreatePayBill(user, miner string, usage int, priKey ed25519.PrivateKey) (*rpcMsg.UserCreditPay, error)

Types

type CmdHandler

type CmdHandler interface {
	HandleRequireServiceRes(accepted bool, credit int64, msg string)
	HandleChargeRes(number int)
	HandleApplyTrail(accepted bool, state int, freeSeconds int)
}

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

type WConfig

type WConfig struct {
	BCAddr   string
	Cipher   string
	Ip       string
	Mac      string
	NodeAddr string
	NodeIP   string
}

type Wallet

type Wallet struct {
	Config *WConfig
	Queue  *Queue
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(addr, cipher, ip, mac, serverIp, password string) (*Wallet, error)

func (*Wallet) Close

func (w *Wallet) Close()

func (*Wallet) Handle

func (w *Wallet) Handle(handler CmdHandler)

func (*Wallet) Open

func (w *Wallet) Open(handler CmdHandler)

func (*Wallet) Receiving

func (w *Wallet) Receiving()

listen and receive msg, put msg in queue

func (*Wallet) Send

func (w *Wallet) Send(req *rpcMsg.UDPReq) error

func (*Wallet) SendCmdAlive

func (w *Wallet) SendCmdAlive() error

func (*Wallet) SendCmdCheck

func (w *Wallet) SendCmdCheck() error

func (*Wallet) SendCmdClose

func (w *Wallet) SendCmdClose()

func (*Wallet) SendCmdRecharge

func (w *Wallet) SendCmdRecharge(no int) error

func (*Wallet) SendCmdRequireService

func (w *Wallet) SendCmdRequireService() error

func (*Wallet) SendCmdTrail

func (w *Wallet) SendCmdTrail() error

func (*Wallet) TestConnection

func (w *Wallet) TestConnection() error

func (*Wallet) VerifyRes

func (w *Wallet) VerifyRes(res *rpcMsg.UDPRes) bool

Jump to

Keyboard shortcuts

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