Documentation
¶
Index ¶
- Variables
- func Get(url string) string
- func GetTableRows(code, scope, table, lowerBound, upperBound string, limit uint32, v interface{}) error
- func Post(url string, data interface{}, contentType string) string
- func Start(tracer opentracing.Tracer, spanName string, ctx context.Context) (newCtx context.Context, finish func(...SpanOption))
- func Utf8ToGbk(s []byte) ([]byte, error)
- type Crontab
- func (c *Crontab) AddByFunc(id string, spec string, f func()) error
- func (c *Crontab) AddByID(id string, spec string, cmd cron.Job) error
- func (c *Crontab) DelByID(id string)
- func (c *Crontab) IDs() []string
- func (c *Crontab) IsExists(jid string) bool
- func (c *Crontab) Start()
- func (c *Crontab) Stop()
- type EmailNotify
- type SpanOption
- type SwapDefiPair
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewEmailNotify)
ProviderSet is util providers.
Functions ¶
func GetTableRows ¶
func GetTableRows(code, scope, table, lowerBound, upperBound string, limit uint32, v interface{}) error
GetTableRows
func Post ¶
Post 发送POST请求 url: 请求地址 data: POST请求提交的数据 contentType: 请求体格式,如:application/json content: 请求放回的内容
Types ¶
type Crontab ¶
type Crontab struct {
// contains filtered or unexported fields
}
Crontab crontab manager
type EmailNotify ¶
type EmailNotify struct { SmtpS string SmtpP int32 Fromer string Ccers []string EUser string Epasswd string }
func NewEmailNotify ¶
func NewEmailNotify(mailConf *conf.Email) *EmailNotify
func (*EmailNotify) SendNotifyWithFile ¶
func (en *EmailNotify) SendNotifyWithFile(toers, title, content string) bool
func (*EmailNotify) SendNotifyWithFileAndAttach ¶
func (en *EmailNotify) SendNotifyWithFileAndAttach(toers, title, content, filePath, newName string) bool
type SpanOption ¶
type SpanOption func(span opentracing.Span)
func SpanWithError ¶
func SpanWithError(err error) SpanOption
func SpanWithLog ¶
func SpanWithLog(arg ...interface{}) SpanOption
example: SpanWithLog(
"event", "soft error", "type", "cache timeout", "waited.millis", 1500)
type SwapDefiPair ¶
type SwapDefiPair struct { ID int `json:"id" gorm:"column:id"` Token0 struct { Symbol string `json:"symbol" gorm:"column:symbol"` Contract string `json:"contract" gorm:"column:contract"` } `json:"token0" gorm:"column:token0"` Token1 struct { Symbol string `json:"symbol" gorm:"column:symbol"` Contract string `json:"contract" gorm:"column:contract"` } `json:"token1" gorm:"column:token1"` BlockTimeLast string `json:"block_time_last" gorm:"column:block_time_last"` LiquidityToken int `json:"liquidity_token,string" gorm:"column:liquidity_token"` Reserve1 string `json:"reserve1" gorm:"column:reserve1"` Reserve0 string `json:"reserve0" gorm:"column:reserve0"` Price0Last float64 `json:"price0_last,string" gorm:"column:price0_last"` Price1Last float64 `json:"price1_last,string" gorm:"column:price1_last"` Price0CumulativeLast int `json:"price0_cumulative_last" gorm:"column:price0_cumulative_last"` Price1CumulativeLast int `json:"price1_cumulative_last" gorm:"column:price1_cumulative_last"` }
func GetSwapDefiPair ¶
func GetSwapDefiPair(pairId string) (error, *SwapDefiPair)
Click to show internal directories.
Click to hide internal directories.