db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 10 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 struct {
	sync.RWMutex
	*os.File
	// contains filtered or unexported fields
}

func Init

func Init(dir string) (*DB, error)

func (*DB) Account

func (d *DB) Account(id int) (*Account, error)

func (*DB) Accounts

func (d *DB) Accounts() ([]*Account, error)

func (*DB) AddAccount

func (d *DB) AddAccount(acc *Account) error

func (*DB) EditAccount

func (d *DB) EditAccount(id int, acc *Account) error

func (*DB) EditElo

func (d *DB) EditElo(id int, elo string) error

func (*DB) RemoveAccount

func (d *DB) RemoveAccount(id int) error

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool
}

Jump to

Keyboard shortcuts

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