bean

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRo

type BlockRo struct {
	Number uint64 `query:"number" validate:"omitempty"`
	Hash   string `query:"hash" validate:"omitempty"`
}

type Event

type Event map[string]interface{}

type EventListRo

type EventListRo struct {
	TaskId  uint     `query:"taskId" json:"taskId" validate:"required,gt=0"`
	Event   string   `query:"event" json:"event" validate:"required,gt=0"`
	Cols    []string `query:"cols" json:"cols" validate:"omitempty"`
	Where   []Where  `query:"where" json:"where" validate:"omitempty"`
	BlockRo *BlockRo `query:"blockRo" json:"blockRo" validate:"omitempty"`
	TxRo    *TxRo    `query:"txRo" json:"txRo" validate:"omitempty"`
	TimeRo  *TimeRo  `query:"timeRo" json:"timeRo" validate:"omitempty"`
	PageRo  *PageRo  `query:"pageRo" json:"pageRo" validate:"required"`
	OrderRo *OrderRo `query:"orderRo" json:"orderRo" validate:"omitempty"`
}

type OrderRo

type OrderRo struct {
	// ASC/DESC
	OrderType string   `query:"orderType" validate:"omitempty,oneof=ASC DESC"`
	Feilds    []string `query:"feilds" validate:"omitempty"`
}

type PageRo

type PageRo struct {
	Cursor uint64 `query:"cursor" validate:"omitempty"`
	Limit  uint64 `query:"limit" validate:"required,lte=100,gte=1"`
}

type Resp

type Resp struct {
	ResCode int         `json:"resCode"`
	ResDesc string      `json:"resDesc"`
	Result  interface{} `json:"result"`
	TraceId string      `json:"traceId,omitempty"`
}

Resp http resp

func (*Resp) Fail

func (r *Resp) Fail(code int, desc string, result interface{}) *Resp

Fail display fail signal

func (*Resp) FailErr

func (r *Resp) FailErr(c echo.Context, err error) *Resp

func (*Resp) FailMsg

func (r *Resp) FailMsg(desc string) *Resp

FailMsg display fail msg

func (*Resp) Success

func (r *Resp) Success(result interface{}) *Resp

Success display successful signal

func (*Resp) SuccessPage

func (r *Resp) SuccessPage(content interface{}, total int64) *Resp

Success display successful result with page info

type ResultPage

type ResultPage struct {
	Content interface{} `json:"content"`
	Total   int64       `json:"total"`
}

ResultPage result with page info

type TaskAddRo

type TaskAddRo struct {
	Contract string `query:"contract" validate:"required,len=42,startswith=0x"`
	Abi      string `query:"abi" validate:"required"`
	ChainId  uint64 `query:"chainId" validate:"required,gt=0"`
	Rpc      string `query:"rpc" validate:"required"`
	Start    uint64 `query:"start" validate:"required,gt=0"`
	// 轮询间隔,建议为区块出块间隔
	Interval uint64 `query:"interval" validate:"required,gt=0"`
}

type TaskDeleteRo

type TaskDeleteRo struct {
	Id uint `json:"id" validate:"required,gt=0"`
}

type TaskPauseRo

type TaskPauseRo struct {
	Id    uint `json:"id" validate:"required,gt=0"`
	Pause uint `json:"pause" validate:"omitempty"`
}

type TaskUpdateRo

type TaskUpdateRo struct {
	Id uint `json:"id" validate:"required,gt=0"`
	TaskAddRo
}

type TimeRo

type TimeRo struct {
	Begin int64 `query:"begin" validate:"omitempty"`
	End   int64 `query:"end" validate:"omitempty"`
}

type TxRo

type TxRo struct {
	Hash string `query:"hash" validate:"omitempty"`
}

type Where

type Where struct {
	Name  string `query:"name" validate:"omitempty"`
	Value string `query:"value" validate:"omitempty"`
	Op    string `query:"op" validate:"omitempty"` // can be =、>、<、<> and any operator supported by sql-database
}

Jump to

Keyboard shortcuts

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