Documentation ¶
Index ¶
- type RewardModel
- func (m *RewardModel) All() ([]models.Reward, error)
- func (m *RewardModel) FindById(id string) (*models.Reward, error)
- func (m *RewardModel) FindByName(name string) (*models.Reward, error)
- func (m *RewardModel) InsertReward(reward *models.Reward) (*mongo.InsertOneResult, error)
- func (m *RewardModel) UpdateReward(reward *models.Reward) (*mongo.UpdateResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RewardModel ¶
type RewardModel struct {
C *mongo.Collection
}
func (*RewardModel) FindById ¶
func (m *RewardModel) FindById(id string) (*models.Reward, error)
FindByID finds a reward by id
func (*RewardModel) FindByName ¶
func (m *RewardModel) FindByName(name string) (*models.Reward, error)
FindByRewardname finds a reward by rewardname
func (*RewardModel) InsertReward ¶
func (m *RewardModel) InsertReward(reward *models.Reward) (*mongo.InsertOneResult, error)
InsertReward inserts a new reward to the database
func (*RewardModel) UpdateReward ¶
func (m *RewardModel) UpdateReward(reward *models.Reward) (*mongo.UpdateResult, error)
UpdateReward updates the reward with the given id when posts, comments or subscribes are added/removed/updated
Click to show internal directories.
Click to hide internal directories.