Documentation ¶
Index ¶
- Constants
- func CoordToPlain(x, y, z int) int64
- func EnableWAL(db *sql.DB) error
- func MigrateAuthDB(db *sql.DB, dbtype DatabaseType) error
- func MigrateBlockDB(db *sql.DB, dbtype DatabaseType) error
- func PlainToCoord(i int64) (x, y, z int)
- type AuthEntry
- type AuthRepository
- type Block
- type BlockRepository
- type DatabaseType
- type PrivRepository
- type PrivilegeEntry
Constants ¶
View Source
const (
MinPlainCoord = -34351347711
)
Variables ¶
This section is empty.
Functions ¶
func CoordToPlain ¶ added in v1.1.2
func MigrateAuthDB ¶ added in v1.1.1
func MigrateAuthDB(db *sql.DB, dbtype DatabaseType) error
func MigrateBlockDB ¶ added in v1.1.2
func MigrateBlockDB(db *sql.DB, dbtype DatabaseType) error
func PlainToCoord ¶ added in v1.1.2
Types ¶
type AuthRepository ¶ added in v1.1.1
type AuthRepository interface { GetByUsername(username string) (*AuthEntry, error) Create(entry *AuthEntry) error Update(entry *AuthEntry) error Delete(id int64) error }
func NewAuthRepository ¶
func NewAuthRepository(db *sql.DB, dbtype DatabaseType) AuthRepository
type BlockRepository ¶ added in v1.1.2
type BlockRepository interface { GetByPos(x, y, z int) (*Block, error) Update(block *Block) error Delete(x, y, z int) error }
func NewBlockRepository ¶ added in v1.1.2
func NewBlockRepository(db *sql.DB, dbtype DatabaseType) BlockRepository
type DatabaseType ¶
type DatabaseType string
const ( DATABASE_SQLITE DatabaseType = "sqlite" DATABASE_POSTGRES DatabaseType = "postgres" )
type PrivRepository ¶ added in v1.1.1
type PrivRepository struct {
// contains filtered or unexported fields
}
func NewPrivilegeRepository ¶
func NewPrivilegeRepository(db *sql.DB, dbtype DatabaseType) *PrivRepository
func (*PrivRepository) Create ¶ added in v1.1.1
func (repo *PrivRepository) Create(entry *PrivilegeEntry) error
func (*PrivRepository) Delete ¶ added in v1.1.1
func (repo *PrivRepository) Delete(id int64, privilege string) error
func (*PrivRepository) GetByID ¶ added in v1.1.1
func (repo *PrivRepository) GetByID(id int64) ([]*PrivilegeEntry, error)
type PrivilegeEntry ¶
Click to show internal directories.
Click to hide internal directories.