Documentation
¶
Index ¶
- type Driver
- type ItemDriver
- type ItemStorage
- func (i ItemStorage) Create(ctx context.Context, create assets.ItemCreate) (*assets.Item, error)
- func (i ItemStorage) Get(ctx context.Context, itemID assets.ItemID) (*assets.Item, error)
- func (i ItemStorage) List(ctx context.Context, filter assets.ItemFilter) ([]*assets.Item, error)
- func (i ItemStorage) Remove(ctx context.Context, itemID assets.ItemID) error
- func (i ItemStorage) Update(ctx context.Context, itemID assets.ItemID, update assets.ItemUpdate) (*assets.Item, error)
- type LinkDriver
- type LinkStorage
- func (l LinkStorage) Create(ctx context.Context, create assets.LinkCreate) (*assets.Link, error)
- func (l LinkStorage) Get(ctx context.Context, linkID assets.LinkID) (*assets.Link, error)
- func (l LinkStorage) List(ctx context.Context, filter assets.LinkFilter) ([]*assets.Link, error)
- func (l LinkStorage) Remove(ctx context.Context, linkID assets.LinkID) error
- func (l LinkStorage) Update(ctx context.Context, linkID assets.LinkID, update assets.LinkUpdate) (*assets.Link, error)
- type PlayerDriver
- type PlayerStorage
- func (p PlayerStorage) Create(ctx context.Context, create assets.PlayerCreate) (*assets.Player, error)
- func (p PlayerStorage) Get(ctx context.Context, playerID assets.PlayerID) (*assets.Player, error)
- func (p PlayerStorage) List(ctx context.Context, filter assets.PlayerFilter) ([]*assets.Player, error)
- func (p PlayerStorage) Remove(ctx context.Context, playerID assets.PlayerID) error
- func (p PlayerStorage) Update(ctx context.Context, playerID assets.PlayerID, update assets.PlayerUpdate) (*assets.Player, error)
- type RoomDriver
- type RoomStorage
- func (r RoomStorage) Create(ctx context.Context, create assets.RoomCreate) (*assets.Room, error)
- func (r RoomStorage) Get(ctx context.Context, roomID assets.RoomID) (*assets.Room, error)
- func (r RoomStorage) List(ctx context.Context, filter assets.RoomFilter) ([]*assets.Room, error)
- func (r RoomStorage) Remove(ctx context.Context, roomID assets.RoomID) error
- func (r RoomStorage) Update(ctx context.Context, roomID assets.RoomID, update assets.RoomUpdate) (*assets.Room, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemDriver ¶
type ItemDriver interface {
Driver
ListQuery(assets.ItemFilter) string
GetQuery() string
CreateQuery() string
UpdateQuery() string
RemoveQuery() string
}
ItemDriver abstracts away the SQL driver specific functionality.
type ItemStorage ¶
type ItemStorage struct {
DB *sql.DB
Driver ItemDriver
}
ItemStorage is used to manage the persistent storage of item data.
func (ItemStorage) Create ¶
func (i ItemStorage) Create(ctx context.Context, create assets.ItemCreate) (*assets.Item, error)
Create persists a new item, returning item information including the newly created itemID.
func (ItemStorage) List ¶
func (i ItemStorage) List(ctx context.Context, filter assets.ItemFilter) ([]*assets.Item, error)
List returns a slice of items based on the balue of the filter.
type LinkDriver ¶
type LinkDriver interface {
Driver
ListQuery(assets.LinkFilter) string
GetQuery() string
CreateQuery() string
UpdateQuery() string
RemoveQuery() string
}
LinkDriver abstracts away the SQL driver specific functionality.
type LinkStorage ¶
type LinkStorage struct {
DB *sql.DB
Driver LinkDriver
}
LinkStorage is used to manage the persistent storage of link data.
func (LinkStorage) Create ¶
func (l LinkStorage) Create(ctx context.Context, create assets.LinkCreate) (*assets.Link, error)
Create persists a new link, returning link information including the newly created linkID.
func (LinkStorage) List ¶
func (l LinkStorage) List(ctx context.Context, filter assets.LinkFilter) ([]*assets.Link, error)
List returns a slice of links based on the balue of the filter.
type PlayerDriver ¶
type PlayerDriver interface {
Driver
ListQuery(assets.PlayerFilter) string
GetQuery() string
CreateQuery() string
UpdateQuery() string
RemoveQuery() string
}
PlayerDriver abstracts away the SQL driver specific functionality.
type PlayerStorage ¶
type PlayerStorage struct {
DB *sql.DB
Driver PlayerDriver
}
PlayerStorage is used to manage the persistent storage of player data.
func (PlayerStorage) Create ¶
func (p PlayerStorage) Create(ctx context.Context, create assets.PlayerCreate) (*assets.Player, error)
Create persists a new player, returning player information including the newly created playerID.
func (PlayerStorage) List ¶
func (p PlayerStorage) List(ctx context.Context, filter assets.PlayerFilter) ([]*assets.Player, error)
List returns a slice of players based on the balue of the filter.
type RoomDriver ¶
type RoomDriver interface {
Driver
ListQuery(assets.RoomFilter) string
GetQuery() string
CreateQuery() string
UpdateQuery() string
RemoveQuery() string
}
RoomDriver abstracts away the SQL driver specific functionality.
type RoomStorage ¶
type RoomStorage struct {
DB *sql.DB
Driver RoomDriver
}
RoomStorage is used to manage the persistent storage of room data.
func (RoomStorage) Create ¶
func (r RoomStorage) Create(ctx context.Context, create assets.RoomCreate) (*assets.Room, error)
Create persists a new room, returning room information including the newly created roomID.
func (RoomStorage) List ¶
func (r RoomStorage) List(ctx context.Context, filter assets.RoomFilter) ([]*assets.Room, error)
List returns a slice of rooms based on the balue of the filter.