mysql

package
v0.0.0-...-a14fa2b Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(db *sql.DB) error

CreateTable create message table.

func Delete

func Delete(db *sql.DB, sign string) error

Delete Clear delete a message.

func GetCode

func GetCode(db *sql.DB, sign string) (string, error)

GetCode return message date and nil or "0"and err.

func GetDate

func GetDate(db *sql.DB, sign string) (int64, error)

GetDate return message date(unixtime) and nil if no err,or (0,err).

func GetMobile

func GetMobile(db *sql.DB, sign string) (string, error)

GetMobile return User's mobile like ID or "0" and err

func Insert

func Insert(db *sql.DB, mobile string, date int64, code string, sign string) error

Insert Insert a new message.

Types

type Message

type Message struct {
	Mobile string `db:"mobile"`
	Date   int64  `db:"date"`
	Code   string `db:"code"`
	Sign   string `db:"sign"`
}

Message -

func GetMessage

func GetMessage(db *sql.DB, sign string) *Message

GetMessage return message

Jump to

Keyboard shortcuts

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