db

package
v0.0.0-...-301f07c Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB *sql.DB
)

DB for bot

Functions

func CreateUserTable

func CreateUserTable()

CreateUserTable table bot_users (id INT PRIMARY KEY, sign INT)

func DropUserTable

func DropUserTable()

DropUserTable bot_users

func GetAllUser

func GetAllUser(out chan<- *User)

GetAllUser get all user from table and send to out ch

func InitDB

func InitDB(url string)

InitDB database heroku from url

Types

type User

type User struct {
	ID   int
	Sign int

	Text  string
	Train []bool
}

User of bot

func (*User) GetUser

func (user *User) GetUser(id int)

GetUser get user by init id

func (*User) ParseSign

func (user *User) ParseSign(count int)

ParseSign to slice bool len count

func (*User) SetTrain

func (user *User) SetTrain(count int)

SetTrain set new slice train

func (*User) String

func (user *User) String() string

Jump to

Keyboard shortcuts

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