repo

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID             uint32
	Username       string
	Salt           []byte
	Verifier       []byte
	SessionKeyAuth []byte
	Locked         bool
	LastIP         string
}

type AccountRepo

type AccountRepo interface {
	AccountByUserName(ctx context.Context, username string) (*Account, error)
	UpdateAccount(ctx context.Context, a *Account) error
}

func NewAccountMySQLRepo

func NewAccountMySQLRepo(db *sql.DB, stmtBuilder StatementsBuilder) (AccountRepo, error)

type AuthStmtType

type AuthStmtType uint8
const (
	AuthStmtTypeGetAccountByUsername AuthStmtType = iota
	AuthStmtTypeUpdateAccountByID

	AuthStmtTypeGetRealmList
	AuthStmtTypeGetCharactersCountOnRealmsByAccount
)

type CharsCountInRealm

type CharsCountInRealm struct {
	RealmID   uint32
	CharCount uint8
}

type Realm

type Realm struct {
	ID                   uint32
	Name                 string
	Icon                 uint8
	Flag                 uint8
	Timezone             uint8
	AllowedSecurityLevel uint8
	GameBuild            uint32
}

type RealmRepo

type RealmRepo interface {
	LoadRealms(ctx context.Context) ([]Realm, error)
	CountCharsPerRealmByAccountID(ctx context.Context, accountID uint32) ([]CharsCountInRealm, error)
}

func NewRealmMySQLRepo

func NewRealmMySQLRepo(db *sql.DB, stmtBuilder StatementsBuilder) (RealmRepo, error)

type StatementsBuilder

type StatementsBuilder interface {
	StmtForType(AuthStmtType) string
}

func StatementsBuilderForSchema

func StatementsBuilderForSchema(schemaType repo.SupportedSchemaType) StatementsBuilder

Jump to

Keyboard shortcuts

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