database

package
v0.0.0-...-446be37 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type IsPunishedPlayerParams

type IsPunishedPlayerParams struct {
	UserUuid   uuid.UUID
	PunishType Punishtype
}

type LogIntoLookupTableParams

type LogIntoLookupTableParams struct {
	UserUuid uuid.UUID
	UserName string
}

type LookupUser

type LookupUser struct {
	UserUuid uuid.UUID
	UserName string
}

type NullPunishtype

type NullPunishtype struct {
	Punishtype Punishtype
	Valid      bool // Valid is true if Punishtype is not NULL
}

func (*NullPunishtype) Scan

func (ns *NullPunishtype) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPunishtype) Value

func (ns NullPunishtype) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type PunishPlayerParams

type PunishPlayerParams struct {
	UserUuid   uuid.UUID
	Reason     string
	DoneBy     string
	PunishType Punishtype
	TimeEnds   time.Time
}

type PunishedUser

type PunishedUser struct {
	ID         int32
	UserUuid   uuid.UUID
	Reason     string
	DoneBy     string
	PunishType Punishtype
	TimeEnds   time.Time
	Createdat  time.Time
}

type Punishtype

type Punishtype string
const (
	PunishtypeBAN  Punishtype = "BAN"
	PunishtypeMUTE Punishtype = "MUTE"
)

func (*Punishtype) Scan

func (e *Punishtype) Scan(src interface{}) error

type Queries

type Queries struct {
	// contains filtered or unexported fields
}
var DB *Queries

func New

func New(db DBTX) *Queries

func (*Queries) CreateLookupUserTable

func (q *Queries) CreateLookupUserTable(ctx context.Context) error

func (*Queries) CreatePunishType

func (q *Queries) CreatePunishType(ctx context.Context) error

func (*Queries) CreatePunishUsersTable

func (q *Queries) CreatePunishUsersTable(ctx context.Context) error

func (*Queries) GetPlayerUUID

func (q *Queries) GetPlayerUUID(ctx context.Context, lower string) (uuid.UUID, error)

func (*Queries) IsPunishedPlayer

func (q *Queries) IsPunishedPlayer(ctx context.Context, arg IsPunishedPlayerParams) (PunishedUser, error)

func (*Queries) LogIntoLookupTable

func (q *Queries) LogIntoLookupTable(ctx context.Context, arg LogIntoLookupTableParams) error

func (*Queries) PunishPlayer

func (q *Queries) PunishPlayer(ctx context.Context, arg PunishPlayerParams) error

func (*Queries) UnpunishPlayer

func (q *Queries) UnpunishPlayer(ctx context.Context, arg UnpunishPlayerParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type UnpunishPlayerParams

type UnpunishPlayerParams struct {
	UserUuid   uuid.UUID
	PunishType Punishtype
}

Jump to

Keyboard shortcuts

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