store

package
v0.0.0-...-a436ee8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 11 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 {
	bun.BaseModel `bun:"table:hk4e_accounts"`

	ID       int64  `bun:",pk,autoincrement"`
	Email    string `bun:",notnull,unique"`
	Username string `bun:",notnull,unique"`
	Password string `bun:",nullzero"`

	LoginToken string `bun:",nullzero"`
	ComboToken string `bun:",nullzero"`

	Timestamp
}

type AccountStore

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

func (*AccountStore) CreateAccount

func (s *AccountStore) CreateAccount(ctx context.Context, record *Account) error

func (*AccountStore) DeleteAccount

func (s *AccountStore) DeleteAccount(ctx context.Context, id int64) error

func (*AccountStore) GetAccount

func (s *AccountStore) GetAccount(ctx context.Context, id int64) (*Account, error)

func (*AccountStore) GetAccountByEmail

func (s *AccountStore) GetAccountByEmail(ctx context.Context, email string) (*Account, error)

func (*AccountStore) GetAccountByUsername

func (s *AccountStore) GetAccountByUsername(ctx context.Context, username string) (*Account, error)

func (*AccountStore) GetAccounts

func (s *AccountStore) GetAccounts(ctx context.Context, offset, limit int) ([]*Account, error)

func (*AccountStore) UpdateAccount

func (s *AccountStore) UpdateAccount(ctx context.Context, record *Account) error

func (*AccountStore) UpdateAccountComboToken

func (s *AccountStore) UpdateAccountComboToken(ctx context.Context, id int64, token string) error

func (*AccountStore) UpdateAccountLoginToken

func (s *AccountStore) UpdateAccountLoginToken(ctx context.Context, id int64, token string) error

func (*AccountStore) UpdateAccountPassword

func (s *AccountStore) UpdateAccountPassword(ctx context.Context, id int64, password string) error

type BlockData

type BlockData struct {
	bun.BaseModel `bun:"table:hk4e_block_data"`

	ID       int64  `bun:",pk,autoincrement"`
	PlayerID int32  `bun:",notnull"`
	BlockID  int32  `bun:",notnull"`
	BinData  []byte `bun:"mediumblob,nullzero"`
	Version  int32  `bun:",notnull"`

	Timestamp
}

type BlockDataStore

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

func (*BlockDataStore) CreateBlockData

func (s *BlockDataStore) CreateBlockData(ctx context.Context, record *BlockData) error

func (*BlockDataStore) DeleteBlockData

func (s *BlockDataStore) DeleteBlockData(ctx context.Context, id int64) error

func (*BlockDataStore) GetAllBlockData

func (s *BlockDataStore) GetAllBlockData(ctx context.Context, offset, limit int) ([]*BlockData, error)

func (*BlockDataStore) GetBlockData

func (s *BlockDataStore) GetBlockData(ctx context.Context, id int64) (*BlockData, error)

func (*BlockDataStore) GetBlockDataByPlayerID

func (s *BlockDataStore) GetBlockDataByPlayerID(ctx context.Context, id, blockID int32) (*BlockData, error)

func (*BlockDataStore) UpdateBlockData

func (s *BlockDataStore) UpdateBlockData(ctx context.Context, record *BlockData) error

type Config

type Config struct {
	bun.BaseModel `bun:"table:hk4e_config"`

	Key   string `bun:"type:varchar(255),pk"`
	Value string `bun:"type:text,nullzero"`

	Timestamp
}

type HomeData

type HomeData struct {
	bun.BaseModel `bun:"table:hk4e_home_data"`

	ID      int32  `bun:",pk,autoincrement"`
	BinData []byte `bun:"mediumblob,nullzero"`
	Version int32  `bun:",notnull"`

	Timestamp
}

type HomeDataStore

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

func (*HomeDataStore) CreateHomeData

func (s *HomeDataStore) CreateHomeData(ctx context.Context, record *HomeData) error

func (*HomeDataStore) DeleteHomeData

func (s *HomeDataStore) DeleteHomeData(ctx context.Context, id int32) error

func (*HomeDataStore) GetAllHomeData

func (s *HomeDataStore) GetAllHomeData(ctx context.Context, offset, limit int) ([]*HomeData, error)

func (*HomeDataStore) GetHomeData

func (s *HomeDataStore) GetHomeData(ctx context.Context, id int32) (*HomeData, error)

func (*HomeDataStore) UpdateHomeData

func (s *HomeDataStore) UpdateHomeData(ctx context.Context, record *HomeData) error

type Player

type Player struct {
	bun.BaseModel `bun:"table:hk4e_players"`

	ID        int32    `bun:",pk,autoincrement"`
	AccountID int64    `bun:",notnull"`
	Account   *Account `bun:"rel:belongs-to,join:account_id=id"`

	Timestamp
}

type PlayerData

type PlayerData struct {
	bun.BaseModel `bun:"table:hk4e_player_data"`

	ID      int32  `bun:",pk,autoincrement"`
	BinData []byte `bun:"mediumblob,nullzero"`
	Version int32  `bun:",notnull"`

	Timestamp
}

type PlayerDataStore

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

func (*PlayerDataStore) CreatePlayerData

func (s *PlayerDataStore) CreatePlayerData(ctx context.Context, record *PlayerData) error

func (*PlayerDataStore) DeletePlayerData

func (s *PlayerDataStore) DeletePlayerData(ctx context.Context, id int32) error

func (*PlayerDataStore) GetAllPlayerData

func (s *PlayerDataStore) GetAllPlayerData(ctx context.Context, offset, limit int) ([]*PlayerData, error)

func (*PlayerDataStore) GetPlayerData

func (s *PlayerDataStore) GetPlayerData(ctx context.Context, id int32) (*PlayerData, error)

func (*PlayerDataStore) UpdatePlayerData

func (s *PlayerDataStore) UpdatePlayerData(ctx context.Context, record *PlayerData) error

type PlayerStore

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

func (*PlayerStore) CreatePlayer

func (s *PlayerStore) CreatePlayer(ctx context.Context, record *Player) error

func (*PlayerStore) DeletePlayer

func (s *PlayerStore) DeletePlayer(ctx context.Context, id int32) error

func (*PlayerStore) GetPlayer

func (s *PlayerStore) GetPlayer(ctx context.Context, id int32) (*Player, error)

func (*PlayerStore) GetPlayerByAccountID

func (s *PlayerStore) GetPlayerByAccountID(ctx context.Context, id int64) (*Player, error)

func (*PlayerStore) GetPlayers

func (s *PlayerStore) GetPlayers(ctx context.Context, offset, limit int) ([]*Player, error)

func (*PlayerStore) UpdatePlayer

func (s *PlayerStore) UpdatePlayer(ctx context.Context, record *Player) error

type Store

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

func NewStore

func NewStore(config *config.Config) *Store

func (*Store) Account

func (s *Store) Account() *AccountStore

func (*Store) BlockData

func (s *Store) BlockData() *BlockDataStore

func (*Store) HomeData

func (s *Store) HomeData() *HomeDataStore

func (*Store) Player

func (s *Store) Player() *PlayerStore

func (*Store) PlayerData

func (s *Store) PlayerData() *PlayerDataStore

type Timestamp

type Timestamp struct {
	CreatedAt time.Time  `bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt time.Time  `bun:",nullzero,notnull,default:current_timestamp"`
	DeletedAt *time.Time `bun:",soft_delete,nullzero"`
}

func (*Timestamp) BeforeAppendModel

func (x *Timestamp) BeforeAppendModel(ctx context.Context, query bun.Query) error

Jump to

Keyboard shortcuts

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