database

package
v0.0.0-...-f573d82 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(cfg config.DatabaseConfig, logger *zap.SugaredLogger) (*Database, error)

func (*Database) Close

func (d *Database) Close()

func (*Database) CreateVerifiedAccountEntry

func (d *Database) CreateVerifiedAccountEntry(v Verification, userID string) error

func (*Database) DeleteVerification

func (d *Database) DeleteVerification(code string) error

func (*Database) FetchVerification

func (d *Database) FetchVerification(code string) (*Verification, error)

func (*Database) GetVerifiedPlayer

func (d *Database) GetVerifiedPlayer(userID string) (*VerifiedPlayer, error)

func (*Database) InsertPlayerCount

func (d *Database) InsertPlayerCount(playerCount int) error

type Verification

type Verification struct {
	Ckey       string    `db:"ckey"`
	DisplayKey string    `db:"display_key"`
	CreatedAt  time.Time `db:"created_at"`
}

type VerifiedPlayer

type VerifiedPlayer struct {
	Ckey          string    `db:"ckey"`
	DisplayKey    string    `db:"display_key"`
	DiscordUserID string    `db:"discord_user_id"`
	CreatedAt     time.Time `db:"created_at"`
}

Jump to

Keyboard shortcuts

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