lib

package
v0.0.0-...-ba2b889 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBNBPrice float64

Functions

func CheckCodeFormatIs4Number

func CheckCodeFormatIs4Number(lineRequest *LineMessage) bool

func CheckCodeWithIn3Hr

func CheckCodeWithIn3Hr(Queries *db.Queries, lineRequest *LineMessage) (bool, int32, int32, error)

func CheckProfileRegisterFromDB

func CheckProfileRegisterFromDB(Queries *db.Queries, profile ProFile) (db.User, bool, error)

func GetActiveChin

func GetActiveChin(CronQueries *db.Queries) (chain model.Chain, err error)

func GetLastBlockTransactionFromBscScan

func GetLastBlockTransactionFromBscScan(CainInfo db.Chain, walletAddress string, lastBlock int32, BSCToken string) (r resultTx, last int32, e error)

func GetLastPriceBNB

func GetLastPriceBNB(CainInfo db.Chain) (usd float64, err error)

func GetPushTextForLineAlert

func GetPushTextForLineAlert(r resultTx, walletAddress string, AccountName string) (string, error)

func MakePushOneUserWithLineAPI

func MakePushOneUserWithLineAPI(messageStr string, user db.User, ChannelToken string) error

func ReplyLineUserWithNormalText

func ReplyLineUserWithNormalText(messageStr string, ChannelToken string, lineRequest *LineMessage) error

func UpdateLineIdByWhereUserIDParams

func UpdateLineIdByWhereUserIDParams(Queries *db.Queries, lineid string, userID int32) error

func UpdateUserOwnerValidation

func UpdateUserOwnerValidation(Queries *db.Queries, userID int32) error

func ValidationLineRequest

func ValidationLineRequest(lineRequest *LineMessage) error

Types

type LineMessage

type LineMessage struct {
	Destination string `json:"destination"`
	Events      []struct {
		ReplyToken string `json:"replyToken"`
		Type       string `json:"type"`
		Timestamp  int64  `json:"timestamp"`
		Source     struct {
			Type   string `json:"type"`
			UserID string `json:"userId"`
		} `json:"source"`
		Message struct {
			ID   string `json:"id"`
			Type string `json:"type"`
			Text string `json:"text"`
		} `json:"message"`
	} `json:"events"`
}

type Message

type Message struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type ProFile

type ProFile struct {
	UserID        string `json:"userId"`
	DisplayName   string `json:"displayName"`
	PictureURL    string `json:"pictureUrl"`
	StatusMessage string `json:"statusMessage"`
}

func GetProfile

func GetProfile(ChannelToken, userId string) (ProFile, error)

type PushRequest

type PushRequest struct {
	To       string    `json:"to"`
	Messages []Message `json:"messages"`
}

type ReplyRequest

type ReplyRequest struct {
	ReplyToken string    `json:"replyToken"`
	Messages   []Message `json:"messages"`
}

Jump to

Keyboard shortcuts

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