dbaccess

package
v0.0.0-...-0d9fe52 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfInQueue

func CheckIfInQueue(userHandle string) (bool, error)

func CheckQueueContents

func CheckQueueContents() (string, error)

func CheckQueueLength

func CheckQueueLength(userHandle string) (bool, int, error)

func EstablishDBConnection

func EstablishDBConnection(toReset bool)

Must be called before any interaction with the DB to initialize the db connection.

func JoinQueue

func JoinQueue(user tgbotapi.Update) error

func KickPerson

func KickPerson(position int64) (chatID int64, err error)

func LeaveQueue

func LeaveQueue(userHandle string) error

func NotifyQueue

func NotifyQueue(position int64) (chatID int64, err error)

Types

type AdminUser

type AdminUser struct {
	AdminID     uint64 `db:"admin_id" note:"serial count"`
	AdminHandle string `db:"admin_handle" note:"Refers to the Telegram handle"`
}

type QueueUser

type QueueUser struct {
	QueueID    uint64    `db:"queue_id" note:"Postgres-generated identifier"`
	UserHandle string    `db:"user_handle" note:"Refers to the Telegram handle"`
	ChatID     int64     `db:"chat_id" note:"Refers to the ID used to identify message chats"`
	Joined_at  time.Time `db:"joined_at" note:"Refers to the time the user joined a queue"`
}

Jump to

Keyboard shortcuts

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