db

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID              int
	Region          string
	Tag             string
	IGN             string
	Username        string
	Password        string
	User            string
	Leaverbuster    int
	Ban             NullTime
	Perma           bool
	PasswordChanged bool
	Pre30           bool
	Elo             string
}

type DB

type DB interface {
	User(ctx context.Context, username string) (*User, error)
	Usernames(ctx context.Context) ([]string, error)
	UserByToken(ctx context.Context, token string) (*User, error)
	AddUser(ctx context.Context, username, password string) error
	RemoveUser(ctx context.Context, username string) error
	EditToken(ctx context.Context, id int, token string) error

	Account(ctx context.Context, id int) (*Account, error)
	Accounts(ctx context.Context) ([]*Account, error)
	AddAccount(ctx context.Context, acc *Account) error
	RemoveAccount(ctx context.Context, id int) error
	EditAccount(ctx context.Context, id int, acc *Account) error
	EditElo(ctx context.Context, id int, elo string) error

	Close() error
}

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool
}

func (*NullTime) Scan

func (nt *NullTime) Scan(value interface{}) error

func (NullTime) Value

func (nt NullTime) Value() (driver.Value, error)

type User

type User struct {
	ID       int
	Username string
	Password string
	Token    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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