api

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Success      int = 0
	ReadBodyErr  int = 1
	UnMarshalErr int = 2
	SessErr      int = 3
	NotAPost     int = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessSig

type AccessSig struct {
	Sig        string `json:"sig"`
	AccesToken string `json:"acces_token"`
}

type MinerDesc

type MinerDesc struct {
	PoolAddr   string `json:"pool_addr"`
	SubAddr    string `json:"sub_addr"`
	PayerAddr  string `json:"payer_addr"`
	HopBalance string `json:"hop_balance"`
	Traffic    string `json:"traffic"`
	GTN        string `json:"gtn"`
	Zone       string `json:"zone"`
	Ip         string `json:"ip"`
}

func GetMinerDetail

func GetMinerDetail(ni *node.NodeIns) *MinerDesc

type MinerInfo

type MinerInfo struct {
}

func (*MinerInfo) ServeHTTP

func (mi *MinerInfo) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MinerUserInfo

type MinerUserInfo struct {
	MainAddr       string `json:"main_addr"`
	HopBalance     string `json:"hop_balance"`
	TrafficBalance string `json:"traffic_balance"`
	TotalTraffic   string `json:"total_traffic"`
	MinerCredit    string `json:"miner_credit"`
}

type Request

type Request struct {
	AccessToken string      `json:"access_token"`
	Data        interface{} `json:"data,omitempty"`
}

type Response

type Response struct {
	ResultCode int         `json:"result_code"`
	Message    string      `json:"message"`
	Data       interface{} `json:"data,omitempty"`
}

type SigVerification

type SigVerification struct {
}

func (*SigVerification) ServeHTTP

func (sv *SigVerification) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UserListInfo

type UserListInfo struct {
	Count    int              `json:"count"`
	PageSize int              `json:"page_size"`
	PageNum  int              `json:"page_num"`
	Users    []*MinerUserInfo `json:"users"`
}

type UserReqParam

type UserReqParam struct {
	PageSize     int  `json:"page_size"`
	PageNum      int  `json:"page_num"`
	ForceRefresh bool `json:"force_refresh"`
}

type UsersCountInMiner

type UsersCountInMiner struct {
}

func (*UsersCountInMiner) ServeHTTP

func (ucm *UsersCountInMiner) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UsersInfoInMiner

type UsersInfoInMiner struct {
}

func (*UsersInfoInMiner) ServeHTTP

func (uim *UsersInfoInMiner) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ValidSigResult

type ValidSigResult struct {
	ResultCode  int    `json:"result_code"` //0 success, 1 session not found, 2 signature not correct, 3 other error
	Message     string `json:"message"`
	AccessToken string `json:"access_token"`
}

type WebAccessToken

type WebAccessToken struct {
}

func (*WebAccessToken) ServeHTTP

func (wat *WebAccessToken) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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