Documentation ¶
Index ¶
- type CharactersRepository
- type GenericRepo
- func (repo *GenericRepo) CreateIndex()
- func (repo *GenericRepo) Delete(id string) error
- func (repo *GenericRepo) DropCollection() error
- func (repo *GenericRepo) FindAll(collector elementCollector) error
- func (repo *GenericRepo) FindAllWithParam(params *db.QueryParams, collector elementCollector) error
- func (repo *GenericRepo) FindByField(key string, value string) (interface{}, error)
- func (repo *GenericRepo) FindByID(id string) (interface{}, error)
- func (repo *GenericRepo) Store(entity interface{}) (interface{}, error)
- func (repo *GenericRepo) Update(item interface{}, id string) error
- func (repo *GenericRepo) UpdateByField(item interface{}, key string, value string) error
- type ItemTemplatesRepository
- type ItemsQuery
- type ItemsRepository
- type PartiesRepository
- type RoomsQuery
- type RoomsRepository
- type ScriptsRepository
- type UsersRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharactersRepository ¶
type CharactersRepository interface { FindAll() ([]*e.Character, error) FindByID(id string) (*e.Character, error) FindAllForUser(userID string) ([]*e.Character, error) FindByName(name string) ([]*e.Character, error) Store(Character *e.Character) (*e.Character, error) Import(Character *e.Character) (*e.Character, error) Update(id string, Character *e.Character) error Delete(id string) error Drop() error }
CharactersRepository repository interface
func NewMongoDBcharactersRepository ¶
func NewMongoDBcharactersRepository(db *db.Client) CharactersRepository
NewMongoDBcharactersRepository creates a new mongodb charactersRepository
type GenericRepo ¶
type GenericRepo struct {
// contains filtered or unexported fields
}
GenericRepo ...
func (*GenericRepo) Delete ¶
func (repo *GenericRepo) Delete(id string) error
Delete an existing entity
func (*GenericRepo) DropCollection ¶
func (repo *GenericRepo) DropCollection() error
DropCollection ... drops the whole collection
func (*GenericRepo) FindAll ¶
func (repo *GenericRepo) FindAll(collector elementCollector) error
FindAll returns all entities
func (*GenericRepo) FindAllWithParam ¶
func (repo *GenericRepo) FindAllWithParam(params *db.QueryParams, collector elementCollector) error
FindAllWithParam returns all entities
func (*GenericRepo) FindByField ¶
func (repo *GenericRepo) FindByField(key string, value string) (interface{}, error)
FindByField ...
func (*GenericRepo) FindByID ¶
func (repo *GenericRepo) FindByID(id string) (interface{}, error)
FindByID ...
func (*GenericRepo) Store ¶
func (repo *GenericRepo) Store(entity interface{}) (interface{}, error)
Store stores a new entity
func (*GenericRepo) Update ¶
func (repo *GenericRepo) Update(item interface{}, id string) error
Update an existing entity
func (*GenericRepo) UpdateByField ¶
func (repo *GenericRepo) UpdateByField(item interface{}, key string, value string) error
UpdateByField an existing entity
type ItemTemplatesRepository ¶
type ItemTemplatesRepository interface { FindAll(query ItemsQuery) ([]*i.ItemTemplate, error) FindByID(id string) (*i.ItemTemplate, error) FindByName(name string) ([]*i.ItemTemplate, error) Store(item *i.ItemTemplate) (*i.ItemTemplate, error) Import(item *i.ItemTemplate) (*i.ItemTemplate, error) Update(id string, item *i.ItemTemplate) error Delete(id string) error Drop() error }
ItemTemplatesRepository repository interface
func NewMongoDBItemTemplatesRepository ¶
func NewMongoDBItemTemplatesRepository(db *db.Client) ItemTemplatesRepository
NewMongoDBItemTemplatesRepository creates a new mongodb charactersRepository
type ItemsQuery ¶
type ItemsQuery struct { Name *string `form:"name"` Description *string `form:"description"` Detail *string `form:"detail"` Type *i.ItemType `form:"type"` SubType *i.ItemSubType `form:"subType"` Quality *i.ItemQuality `form:"quality"` Slot *i.ItemSlot `form:"slot"` Level *int32 `form:"level"` }
ItemsQuery ...
type ItemsRepository ¶
type ItemsRepository interface { FindAll(query ItemsQuery) ([]*i.Item, error) FindByID(id string) (*i.Item, error) FindByName(name string) ([]*i.Item, error) Store(item *i.Item) (*i.Item, error) Import(item *i.Item) (*i.Item, error) Update(id string, item *i.Item) error Delete(id string) error Drop() error }
ItemsRepository repository interface
func NewMongoDBItemsRepository ¶
func NewMongoDBItemsRepository(db *db.Client) ItemsRepository
NewMongoDBItemsRepository creates a new mongodb charactersRepository
type PartiesRepository ¶
type PartiesRepository interface { FindAll() ([]*e.Party, error) FindByID(id string) (*e.Party, error) //FindByName(name string) (*e.Party, error) Store(party *e.Party) (*e.Party, error) Update(id string, party *e.Party) error Delete(id string) error }
PartiesRepository repository interface
func NewMongoDBPartiesRepository ¶
func NewMongoDBPartiesRepository(db *db.Client) PartiesRepository
NewMongoDBPartiesRepository creates a new mongodb partiesrep
type RoomsQuery ¶
type RoomsQuery struct { Name *string `form:"name"` Description *string `form:"description"` Detail *string `form:"detail"` RoomType *string `form:"roomType"` Area *string `form:"area"` AreaType *string `form:"areaType"` }
RoomsQuery ...
type RoomsRepository ¶
type RoomsRepository interface { FindAll() ([]*r.Room, error) FindAllWithQuery(query RoomsQuery) ([]*r.Room, error) FindByID(id string) (*r.Room, error) FindByName(name string) ([]*r.Room, error) Store(room *r.Room) (*r.Room, error) Import(room *r.Room) (*r.Room, error) Update(id string, room *r.Room) error Delete(id string) error Drop() error }
RoomsRepository repository interface
func NewMongoDBRoomsRepository ¶
func NewMongoDBRoomsRepository(db *db.Client) RoomsRepository
NewMongoDBRoomsRepository creates a new mongodb repoRepository
type ScriptsRepository ¶
type ScriptsRepository interface { FindAll() ([]*s.Script, error) FindByID(id string) (*s.Script, error) FindByName(name string) ([]*s.Script, error) Store(script *s.Script) (*s.Script, error) Import(script *s.Script) (*s.Script, error) Update(id string, script *s.Script) error Delete(id string) error Drop() error }
ScriptsRepository repository interface
func NewMongoDBScriptRepository ¶
func NewMongoDBScriptRepository(db *db.Client) ScriptsRepository
NewMongoScriptRepository creates a new mongodb charactersRepository
type UsersRepository ¶
type UsersRepository interface { FindByRefID(id string) (*e.User, error) FindByID(id string) (*e.User, error) FindAll() ([]*e.User, error) FindAllOnline() ([]*e.User, error) Create(user *e.User) (*e.User, error) Import(user *e.User) (*e.User, error) Update(id string, user *e.User) error Delete(id string) error Drop() error }
UsersRepository ...
func NewMongoDBUsersRepository ¶
func NewMongoDBUsersRepository(db *db.Client) UsersRepository
NewMongoDBUsersRepository creates a new mongodb partiesrep