controller

package
v0.0.0-...-0584d29 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountEachPage = 25
	AccountMaxPage  = 20
	GCAPVerifyUrl   = "https://www.google.com/recaptcha/api/siteverify"
	GCAPSecretKey   = "6Lc1vF8UAAAAAGv1XihAK4XygBMn3UobipWMqBym"

	ApplyAccountPerIPPerDay = 5
	ApplyHost               = "127.0.0.1:8005"
	ApplyNet                = "testnet"
	ApplyMK                 = "createdByExplorer"
)
View Source
const (
	TxEachPageNum = 25
	TxMaxPage     = 20
)
View Source
const (
	BlockEachPageNum = 30
)

Variables

View Source
var (
	GCAPHttpClient  *http.Client
	ApplyHTTPClient *http.Client

	ErrGreCaptcha = errors.New("reCAPTCHA check failed")
	ErrApplyFreq  = errors.New("client ip create account exceeds limit")
)
View Source
var (
	ErrInvalidInput     = errors.New("invalid input")
	ErrMobileVerfiy     = errors.New("mobile verify failed")
	ErrOutOfRetryTime   = errors.New("out of retry time")
	ErrOutOfCheckTxHash = errors.New("out of check txHash retry time")
	RegEmail            = regexp.MustCompile(`\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`)
)

Functions

func ApplyIOST

func ApplyIOST(c echo.Context) error

func CalculateAward

func CalculateAward(c echo.Context, ainfo db.AwardInfo) (err error)

func DropDatabase

func DropDatabase(c echo.Context) error

func GetAccountDetail

func GetAccountDetail(c echo.Context) error

func GetAccountTxs

func GetAccountTxs(c echo.Context) error

func GetAccounts

func GetAccounts(c echo.Context) error

func GetBPLastProducer

func GetBPLastProducer(c echo.Context) (err error)

func GetBPList

func GetBPList(c echo.Context) error

func GetBlockDetail

func GetBlockDetail(c echo.Context) error

func GetBlocks

func GetBlocks(c echo.Context) error

func GetIndexBlocks

func GetIndexBlocks(c echo.Context) error

func GetIndexTxns

func GetIndexTxns(c echo.Context) error

func GetMarket

func GetMarket(c echo.Context) error

func GetProducerAward

func GetProducerAward(c echo.Context) (err error)

func GetProducerContributionAward

func GetProducerContributionAward(c echo.Context) (err error)

func GetSearch

func GetSearch(c echo.Context) error

func GetTxnDetail

func GetTxnDetail(c echo.Context) error

func GetTxs

func GetTxs(c echo.Context) error

func GetUserAward

func GetUserAward(c echo.Context) error

func GetUserContributionAward

func GetUserContributionAward(c echo.Context) error

func GetVoteAwardInfo

func GetVoteAwardInfo(c echo.Context) (err error)

func GetVoteAwardList

func GetVoteAwardList(c echo.Context) (err error)

func RegistBP

func RegistBP(c echo.Context) (err error)

func SendMail

func SendMail(c echo.Context) error

func SetProducerContributions

func SetProducerContributions(c echo.Context) (err error)

func SetVoteAwardInfo

func SetVoteAwardInfo(c echo.Context) (err error)

func SyncBP

func SyncBP()

Types

type AccountOutput

type AccountOutput struct {
	Name    string  `json:"address"`
	Balance float64 `json:"balance"`
	TxCount int     `json:"txCount"`
}

type AccountTxsOutput

type AccountTxsOutput struct {
	Name     string          `json:"address"`
	TxnList  []*model.TxJson `json:"txnList"`
	TxnLen   int             `json:"txnLen"`
	PageLast int             `json:"pageLast"`
}

type AccountsOutput

type AccountsOutput struct {
	AccountList []*AccountOutput `json:"accountList"`
	Page        int              `json:"page"`
	PagePrev    int              `json:"pagePrev"`
	PageNext    int              `json:"pageNext"`
	PageLast    int              `json:"pageLast"`
	TotalLen    int              `json:"totalLen"`
}

type BPAccountDetail

type BPAccountDetail struct {
	Name       string `json:"name"`
	Pubkey     string `json:"pubkey"`
	Loc        string `json:"loc"`
	Url        string `json:"url"`
	NetId      string `json:"netId"`
	IsProducer bool   `json:"isProducer"`
	Status     int    `json:"status"`
	Online     bool   `json:"online"`
}

type BlockListOutput

type BlockListOutput struct {
	BlockList []*model.BlockOutput `json:"blockList"`
	Page      int64                `json:"page"`
	PagePrev  int64                `json:"pagePrev"`
	PageNext  int64                `json:"pageNext"`
	PageLast  int64                `json:"pageLast"`
}

type CommOutput

type CommOutput struct {
	Ret int    `json:"ret"`
	Msg string `json:"msg"`
}

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type GCAPResponse

type GCAPResponse struct {
	Success     bool   `json:"success"`
	ChallengeTs string `json:"challengeTs"`
	Hostname    string `json:"hostname"`
}

type Response

type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
}

func FormatResponse

func FormatResponse(data interface{}) Response

func FormatResponseFailed

func FormatResponseFailed(data interface{}) Response

type SearchOutput

type SearchOutput struct {
	Search string `json:"search"`
	Type   string `json:"type"`
	Text   string `json:"text,omitempty"`
}

type TxsOutput

type TxsOutput struct {
	TxList   []*model.TxnDetail `json:"txsList"`
	Page     int64              `json:"page"`
	PagePrev int64              `json:"pagePrev"`
	PageNext int64              `json:"pageNext"`
	PageLast int64              `json:"pageLast"`
	TotalLen int                `json:"totalLen"`
}

Jump to

Keyboard shortcuts

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