structs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package structs contains the definition of the structures for the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	XID        string
	TelegramID int
	URL        string
	Time       time.Time
	UnixTime   int64
}

Request represents a request. It contains an unique identifier, the Telegram ID of the user, the URL that was returned to the user, the timestamp of the request and an Unix representation of the time to be used for the table TTL, if needed.

func (Request) Table

func (Request) Table() string

Table returns the name of the Request table reading it from the environment variables.

type User

type User struct {
	TelegramID    int
	IsAdmin       bool
	HasBlockedBot bool
}

User represents a telegram user. It contains the Telegram ID of the user, a boolean field indicating whether it's an admin and a boolean flag that tells if the user blocked the bot.

func (User) Table

func (User) Table() string

Table returns the name of the User table reading it from the environment variables.

Jump to

Keyboard shortcuts

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