Documentation
¶
Index ¶
- Variables
- type AvatarDAO
- func (a *AvatarDAO) Delete(avatar AvatarDTO) error
- func (a *AvatarDAO) FindAll() ([]AvatarDAO, error)
- func (a *AvatarDAO) FindByID(id string) (AvatarDTO, error)
- func (a *AvatarDAO) Insert(avatar AvatarDTO) error
- func (a *AvatarDAO) InsertOrUpdate(avatar AvatarDTO) error
- func (a *AvatarDAO) Update(avatar AvatarDTO) error
- type AvatarDTO
- type DBAccess
- type Repository
- type RoomDAO
- type RoomDTO
- type WorldDAO
- type WorldDTO
Constants ¶
This section is empty.
Variables ¶
var AccessModule = fx.Provide(func() (*DBAccess, error) { if session, err := mgo.Dial("0.0.0.0:27017"); err == nil { return NewDBAccess(session, databaseName), nil } else { return nil, err } })
AccessModule ... exports dbaccess module
var RepositoryModule = fx.Provide(func(dba *DBAccess) *Repository { return &Repository{ Avatars: NewAvatarDAO(dba), Rooms: NewRoomDAO(dba), Worlds: NewWorldDAO(dba), } })
RepositoryModule ... exports dbaccess module
Functions ¶
This section is empty.
Types ¶
type AvatarDAO ¶
type AvatarDAO struct {
// contains filtered or unexported fields
}
AvatarDAO ... datatype for the ruleset
func NewAvatarDAO ¶
NewAvatarDAO ... creates a new ruleset
func (*AvatarDAO) InsertOrUpdate ¶
InsertOrUpdate ... insert or update an existing room by id
type AvatarDTO ¶
type AvatarDTO struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` Name string `json:"name"` Description string `json:"description"` CreationDate time.Time `json:"creationDate,omitempty"` CurrentRoomID string `json:"lastKnownRoomID,omitempty" bson:"lastKnownRoomID,omitempty"` UserID string `json:"userID"` }
AvatarDTO ... dto to store data related to avatars Avatars can be either controlled by Players/Users or be attached/belong to bots Once a user is logged in he automatically gets attached his last used aavatar
type DBAccess ¶
DBAccess ... datatype for the ruleset
func NewDBAccess ¶
NewDBAccess ... creates a new ruleset
func (*DBAccess) C ¶
func (dba *DBAccess) C(collection string) *mgo.Collection
C ... returns collection
func (*DBAccess) CreateDatabase ¶
func (dba *DBAccess) CreateDatabase()
CreateDatabase ... creates initial database value
type Repository ¶
Repository ... datatype for the ruleset
type RoomDAO ¶
type RoomDAO struct {
// contains filtered or unexported fields
}
RoomDAO ... datatype for the ruleset
type RoomDTO ¶
type RoomDTO struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` Title string `json:"title"` Description string `json:"description"` DateCreated time.Time `json:"dateCreated,omitempty"` }
RoomDTO ... default entity to structure rooms
type WorldDAO ¶
type WorldDAO struct {
// contains filtered or unexported fields
}
WorldDAO ... datatype for the ruleset
type WorldDTO ¶
type WorldDTO struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` DateCreated time.Time `json:"dateCreated,omitempty"` Description string `json:"description,omitempty"` Rooms []*RoomDTO `json:"rooms,omitempty"` Avatars []*AvatarDTO `json:"avatars,omitempty"` StartingRoomID string `json:"startingRoomId,omitempty"` }
WorldDTO ... default entity to structure rooms Everything regarding content and live/dynamic data such as items, avatars, room shall be managed from the World class - all generic game/message/command related things will reside in the game class
func NewWorldDTO ¶
NewWorldDTO ... creates and returns a new room instance