Documentation
¶
Index ¶
- type Driver
- type ItemDriver
- type ItemStorage
- func (i ItemStorage) Create(ctx context.Context, create asset.ItemCreate) (*asset.Item, error)
- func (i ItemStorage) Get(ctx context.Context, itemID asset.ItemID) (*asset.Item, error)
- func (i ItemStorage) List(ctx context.Context, filter asset.ItemFilter) ([]*asset.Item, error)
- func (i ItemStorage) Remove(ctx context.Context, itemID asset.ItemID) error
- func (i ItemStorage) Update(ctx context.Context, itemID asset.ItemID, update asset.ItemUpdate) (*asset.Item, error)
- type LinkDriver
- type LinkStorage
- func (l LinkStorage) Create(ctx context.Context, create asset.LinkCreate) (*asset.Link, error)
- func (l LinkStorage) Get(ctx context.Context, linkID asset.LinkID) (*asset.Link, error)
- func (l LinkStorage) List(ctx context.Context, filter asset.LinkFilter) ([]*asset.Link, error)
- func (l LinkStorage) Remove(ctx context.Context, linkID asset.LinkID) error
- func (l LinkStorage) Update(ctx context.Context, linkID asset.LinkID, update asset.LinkUpdate) (*asset.Link, error)
- type PlayerDriver
- type PlayerStorage
- func (p PlayerStorage) Create(ctx context.Context, create asset.PlayerCreate) (*asset.Player, error)
- func (p PlayerStorage) Get(ctx context.Context, playerID asset.PlayerID) (*asset.Player, error)
- func (p PlayerStorage) List(ctx context.Context, filter asset.PlayerFilter) ([]*asset.Player, error)
- func (p PlayerStorage) Remove(ctx context.Context, playerID asset.PlayerID) error
- func (p PlayerStorage) Update(ctx context.Context, playerID asset.PlayerID, update asset.PlayerUpdate) (*asset.Player, error)
- type RoomDriver
- type RoomStorage
- func (r RoomStorage) Create(ctx context.Context, create asset.RoomCreate) (*asset.Room, error)
- func (r RoomStorage) Get(ctx context.Context, roomID asset.RoomID) (*asset.Room, error)
- func (r RoomStorage) List(ctx context.Context, filter asset.RoomFilter) ([]*asset.Room, error)
- func (r RoomStorage) Remove(ctx context.Context, roomID asset.RoomID) error
- func (r RoomStorage) Update(ctx context.Context, roomID asset.RoomID, update asset.RoomUpdate) (*asset.Room, error)
- type UserDriver
- type UserStorage
- func (u UserStorage) AssociatePlayer(ctx context.Context, userID user.ID, assoc user.AssociatePlayer) (*user.User, error)
- func (u UserStorage) Create(ctx context.Context, create user.Create) (*user.User, error)
- func (u UserStorage) Get(ctx context.Context, userID user.ID) (*user.User, error)
- func (u UserStorage) List(ctx context.Context, filter user.Filter) ([]*user.User, error)
- func (u UserStorage) Remove(ctx context.Context, userID user.ID) error
- func (u UserStorage) Update(ctx context.Context, userID user.ID, update user.Update) (*user.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemDriver ¶
type ItemDriver interface {
Driver
ListQuery(asset.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 asset.ItemCreate) (*asset.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 asset.ItemFilter) ([]*asset.Item, error)
List returns a slice of items based on the balue of the filter.
type LinkDriver ¶
type LinkDriver interface {
Driver
ListQuery(asset.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 asset.LinkCreate) (*asset.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 asset.LinkFilter) ([]*asset.Link, error)
List returns a slice of links based on the balue of the filter.
type PlayerDriver ¶
type PlayerDriver interface {
Driver
ListQuery(asset.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 asset.PlayerCreate) (*asset.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 asset.PlayerFilter) ([]*asset.Player, error)
List returns a slice of players based on the balue of the filter.
type RoomDriver ¶
type RoomDriver interface {
Driver
ListQuery(asset.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 asset.RoomCreate) (*asset.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 asset.RoomFilter) ([]*asset.Room, error)
List returns a slice of rooms based on the balue of the filter.
type UserDriver ¶ added in v0.1.2
type UserDriver interface {
Driver
ListQuery(user.Filter) string
GetQuery() string
CreateQuery() string
UpdateQuery() string
AssociatePlayerQuery() string
RemoveQuery() string
}
UserDriver abstracts away the SQL driver specific functionality.
type UserStorage ¶ added in v0.1.2
type UserStorage struct {
DB *sql.DB
Driver UserDriver
}
UserStorage is used to manage the persistent storage of user data.
func (UserStorage) AssociatePlayer ¶ added in v0.2.7
func (u UserStorage) AssociatePlayer(ctx context.Context, userID user.ID, assoc user.AssociatePlayer) (*user.User, error)
AssociatePlayer associates a player with the user, returning the updated user.
func (UserStorage) Create ¶ added in v0.1.2
Create persists a new user, returning user information including the newly created userID.
func (UserStorage) List ¶ added in v0.1.2
List returns a slice of users based on the balue of the filter.