Documentation
¶
Index ¶
- func IncreaseUserCoins(d Deps, id bson.ObjectId, coins int) error
- func IncreaseUserSwords(d Deps, id bson.ObjectId, swords int) error
- func IncreaseUserTribute(d Deps, id bson.ObjectId, tribute int) error
- type BadgeModel
- type Deps
- type Module
- type Post
- type RankByBadges
- type RankByCoins
- type RankBySwords
- type RankPosition
- type RankPositions
- type RankingModel
- type RankingPositionModel
- type RankingUserModel
- type RuleModel
- type Rules
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncreaseUserCoins ¶
IncreaseUserCoins for given id.
func IncreaseUserSwords ¶
IncreaseUserSwords for given id.
Types ¶
type BadgeModel ¶
type BadgeModel struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` Type string `bson:"type" json:"type"` TypeLabel string `bson:"type_label" json:"type_label"` Slug string `bson:"slug" json:"slug"` Name string `bson:"name" json:"name"` Description string `bson:"description" json:"description"` Coins int `bson:"coins,omitempty" json:"coins,omitempty"` RequiredBadge bson.ObjectId `bson:"required_badge,omitempty" json:"required_badge,omitempty"` RequiredLevel int `bson:"required_level,omitempty" json:"required_level,omitempty"` Avaliable bool `bson:"available" json:"available"` }
type Deps ¶
type Deps interface { Mgo() *mgo.Database GamingConfig() *model.GamingRules }
type Module ¶
type Module struct { User *user.Module `inject:""` Feed *feed.FeedModule `inject:""` Config *config.Config `inject:""` Errors *exceptions.ExceptionsModule `inject:""` Rules Rules }
func (*Module) GetRankingBy ¶
func (self *Module) GetRankingBy(sort string) []RankingModel
func (*Module) ResetGeneralRanking ¶
func (self *Module) ResetGeneralRanking()
type RankByBadges ¶
type RankByBadges []RankingModel
func (RankByBadges) Len ¶
func (a RankByBadges) Len() int
func (RankByBadges) Less ¶
func (a RankByBadges) Less(i, j int) bool
func (RankByBadges) Swap ¶
func (a RankByBadges) Swap(i, j int)
type RankByCoins ¶
type RankByCoins []RankingModel
func (RankByCoins) Len ¶
func (a RankByCoins) Len() int
func (RankByCoins) Less ¶
func (a RankByCoins) Less(i, j int) bool
func (RankByCoins) Swap ¶
func (a RankByCoins) Swap(i, j int)
type RankBySwords ¶
type RankBySwords []RankingModel
func (RankBySwords) Len ¶
func (a RankBySwords) Len() int
func (RankBySwords) Less ¶
func (a RankBySwords) Less(i, j int) bool
func (RankBySwords) Swap ¶
func (a RankBySwords) Swap(i, j int)
type RankPosition ¶
type RankPositions ¶
type RankPositions []RankPosition
func (RankPositions) Len ¶
func (a RankPositions) Len() int
func (RankPositions) Less ¶
func (a RankPositions) Less(i, j int) bool
func (RankPositions) Swap ¶
func (a RankPositions) Swap(i, j int)
type RankingModel ¶
type RankingModel struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"` UserId bson.ObjectId `bson:"user_id" json:"user_id"` Badges int `bson:"badges" json:"badges"` Swords int `bson:"swords" json:"swords"` Coins int `bson:"coins" json:"coins"` Position RankingPositionModel `bson:"position" json:"position"` Before RankingPositionModel `bson:"before" json:"before"` User RankingUserModel `bson:"-" json:"user,omitempty"` Created time.Time `bson:"created_at" json:"created_at"` }
type RankingPositionModel ¶
type RankingUserModel ¶
type Rules ¶
type Rules struct { Updated time.Time `json:"updated_at"` Rules []RuleModel `json:"rules"` Badges []BadgeModel `json:"badges,omitempty"` }
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) SyncToLevel ¶
Sync user gamification relevant facts
Click to show internal directories.
Click to hide internal directories.