db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProfileAlreadyExists = errors.New("profile already exists")
)
View Source
var (
	ErrUserAlreadyExists = errors.New("user already exists")
)

Functions

This section is empty.

Types

type DB

type DB interface {
	Close()
	CreateProfile(profile *ProfileDB) error
	GetProfileById(userId uuid.UUID) (*ProfileDB, error)
	GetAllShipTypes() ([]*ShipType, error)
}

func NewConnection

func NewConnection() (DB, error)

type Door

type Door struct {
	RoomBlockOneId int
	RoomBlockTwoId int
}

type ProfileDB

type ProfileDB struct {
	UserId uuid.UUID `db:"user_id"`
	Name   string    `db:"name"`
}

type RoomBlock

type RoomBlock struct {
	Id   int
	PosX int
	PosY int
}

type RoomPlace

type RoomPlace struct {
	Id            int
	RoomBlockList []*RoomBlock
}

type ShipType

type ShipType struct {
	Id              uuid.UUID      `db:"id"`
	Name            string         `db:"name"`
	RoomPlaceList   []*RoomPlace   `db:"rome_place_list"`
	DoorList        []*Door        `db:"door_list"`
	WeaponPlaceList []*WeaponPlace `db:"weapon_place_list"`
}

type WeaponPlace

type WeaponPlace struct {
	PosX int
	PosY int
}

Jump to

Keyboard shortcuts

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