Documentation
¶
Index ¶
- Constants
- Variables
- type Item
- type ItemChange
- type ItemCreate
- type ItemFilter
- type ItemID
- type ItemLocationID
- type ItemUpdate
- type Link
- type LinkChange
- type LinkCreate
- type LinkFilter
- type LinkID
- type LinkUpdate
- type LocationID
- type LocationType
- type Player
- type PlayerChange
- type PlayerCreate
- type PlayerFilter
- type PlayerID
- type PlayerUpdate
- type Room
- type RoomChange
- type RoomCreate
- type RoomFilter
- type RoomID
- type RoomUpdate
Constants ¶
const ( MaxItemNameLen = 256 MaxItemDescriptionLen = 4096 DefaultItemFilterLimit = 50 MaxItemFilterLimit = 100 )
const ( LocationTypeRoom = LocationType(iota) LocationTypePlayer LocationTypeItem )
const ( MaxLinkNameLen = 256 MaxLinkDescriptionLen = 4096 DefaultLinkFilterLimit = 50 MaxLinkFilterLimit = 100 )
const ( MaxPlayerNameLen = 256 MaxPlayerDescriptionLen = 4096 DefaultPlayerFilterLimit = 50 MaxPlayerFilterLimit = 100 )
const ( MaxRoomNameLen = 256 MaxRoomDescriptionLen = 4096 DefaultRoomFilterLimit = 50 MaxRoomFilterLimit = 100 )
Variables ¶
var (
NilLinkID = LinkID(uuid.Nil)
)
var (
NilLocationID = LocationID(uuid.Nil)
)
var (
NilPlayerID = PlayerID(uuid.Nil)
)
var (
NilRoomID = RoomID(uuid.Nil)
)
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
ID ItemID
Name string
Description string
OwnerID PlayerID
LocationID ItemLocationID
Created arcade.Timestamp
Updated arcade.Timestamp
}
Item is the internal representation of an item.
type ItemChange ¶
type ItemChange struct {
Name string
Description string
OwnerID PlayerID
LocationID ItemLocationID
}
ItemChange holds information to change an item.
type ItemFilter ¶
type ItemFilter struct {
// OwnerID filters for items owned by the given player.
OwnerID PlayerID
// LocationID filters for items in the given location.
LocationID ItemLocationID
// Offset is used to restrict to a subset of the results,
// indicating the initial offset into the set of results.
Offset uint
// Limit is used to restrict to a subset of the results,
// indicating the maximum number of results to return.
Limit uint
}
ItemFilter is used to filter results from a list of all items.
type ItemID ¶
ItemID is the unique identifier of an item.
func (ItemID) ID ¶
func (i ItemID) ID() LocationID
func (ItemID) Type ¶
func (i ItemID) Type() LocationType
type ItemLocationID ¶
type ItemLocationID interface {
ID() LocationID
Type() LocationType
}
ItemLocationID defines the expected behavior of an object that contain an item.
type Link ¶
type Link struct {
ID LinkID
Name string
Description string
OwnerID PlayerID
LocationID RoomID
DestinationID RoomID
Created arcade.Timestamp
Updated arcade.Timestamp
}
Link is the internal representation of a link.
type LinkChange ¶
type LinkChange struct {
Name string
Description string
OwnerID PlayerID
LocationID RoomID
DestinationID RoomID
}
LinkChange holds information to change an item.
type LinkFilter ¶
type LinkFilter struct {
// OwnerID filters for links owned by a given link.
OwnerID PlayerID
// LocationID filters for links located in a location link.
LocationID RoomID
// DestinationID filters for links connected to the given destination.
DestinationID RoomID
// Offset is used to restrict to a subset of the results,
// indicating the initial offset into the set of results.
Offset uint
// Limit is used to restrict to a subset of the results,
// indicating the maximum number of results to return.
Limit uint
}
LinkFilter is used to filter results from a List.
type LocationID ¶
LocationID provides the ID of the item's location.
func (*LocationID) Scan ¶
func (l *LocationID) Scan(src any) error
func (LocationID) String ¶
func (l LocationID) String() string
type LocationType ¶
type LocationType uint8
LocationType provides the type of location, room, player, or item.
func (LocationType) String ¶
func (t LocationType) String() string
type Player ¶
type Player struct {
ID PlayerID
Name string
Description string
HomeID RoomID
LocationID RoomID
Created arcade.Timestamp
Updated arcade.Timestamp
}
Player is the internal representation of the data related to a player.
type PlayerChange ¶
PlayerChange holds information to change an item.
type PlayerCreate ¶
type PlayerCreate struct {
PlayerChange
}
PlayerCreate is used to create an item.
type PlayerFilter ¶
type PlayerFilter struct {
// LocationID filters for players in a given location.
LocationID RoomID
// Offset is used to restrict to a subset of the results,
// indicating the initial offset into the set of results.
Offset uint
// Limit is used to restrict to a subset of the results,
// indicating the maximum number of results to return.
Limit uint
}
PlayerFilter is used to filter results from List.
type PlayerID ¶
PlayerID is the unique identifier of an player.
func (PlayerID) ID ¶
func (p PlayerID) ID() LocationID
func (PlayerID) Type ¶
func (p PlayerID) Type() LocationType
type PlayerUpdate ¶
type PlayerUpdate struct {
PlayerChange
}
PlayerUpdate is used to update an item.
type Room ¶
type Room struct {
ID RoomID
Name string
Description string
OwnerID PlayerID
ParentID RoomID
Created arcade.Timestamp
Updated arcade.Timestamp
}
Room is the internal representation of the data related to a room.
type RoomChange ¶
RoomChange holds information to change an item.
type RoomFilter ¶
type RoomFilter struct {
// OwnerID filters for rooms owned by a given room.
OwnerID PlayerID
// ParentID filters for rooms located in a parent room (non-recursive).
ParentID RoomID
// Offset is used to restrict to a subset of the results,
// indicating the initial offset into the set of results.
Offset uint
// Limit is used to restrict to a subset of the results,
// indicating the maximum number of results to return.
Limit uint
}
RoomFilter is used to filter results from a List.
type RoomID ¶
RoomID is the unique identifier of an room.
func (RoomID) ID ¶
func (r RoomID) ID() LocationID
func (RoomID) Type ¶
func (r RoomID) Type() LocationType