Documentation
¶
Index ¶
- func Create(dto habitapi.DTO, collectionName string, db *mongo.Database) (interface{}, bson.ObjectID, error)
- func Delete(id string, collectionName string, db *mongo.Database) error
- func GetById(id string, collectionName string, empty interface{}, db *mongo.Database) (interface{}, error)
- func InitMongo(mongo_uri string, credential Credential) (*mongo.Client, error)
- func List[T any](collectionName string, empty []*T, db *mongo.Database) ([]*T, error)
- func Update(id string, dto habitapi.DTO, collectionName string, db *mongo.Database) (interface{}, error)
- type Credential
- type DeedService
- func (s *DeedService) Create(dto habitapi.CreateDeedDTO) (*habitapi.Deed, error)
- func (s *DeedService) Delete(id string) error
- func (s *DeedService) GetById(id string) (*habitapi.Deed, error)
- func (s *DeedService) List() ([]*habitapi.Deed, error)
- func (s *DeedService) Update(id string, dto habitapi.UpdateDeedDTO) (*habitapi.Deed, error)
- type HabitGroupService
- func (s *HabitGroupService) Create(dto habitapi.CreateHabitGroupDTO) (*habitapi.HabitGroup, error)
- func (s *HabitGroupService) Delete(id string) error
- func (s *HabitGroupService) GetById(id string) (*habitapi.HabitGroup, error)
- func (s *HabitGroupService) List() ([]*habitapi.HabitGroup, error)
- func (s *HabitGroupService) Update(id string, dto habitapi.UpdateHabitGroupDTO) (*habitapi.HabitGroup, error)
- type HabitService
- func (s *HabitService) Create(dto habitapi.CreateHabitDTO) (*habitapi.Habit, error)
- func (s *HabitService) Delete(id string) error
- func (s *HabitService) GetById(id string) (*habitapi.Habit, error)
- func (s *HabitService) List() ([]*habitapi.Habit, error)
- func (s *HabitService) Update(id string, dto habitapi.UpdateHabitDTO) (*habitapi.Habit, error)
- type RewardService
- func (s *RewardService) Create(dto habitapi.CreateRewardDTO) (*habitapi.Reward, error)
- func (s *RewardService) Delete(id string) error
- func (s *RewardService) GetById(id string) (*habitapi.Reward, error)
- func (s *RewardService) List() ([]*habitapi.Reward, error)
- func (s *RewardService) Update(id string, dto habitapi.UpdateRewardDTO) (*habitapi.Reward, error)
- type UserService
- func (s *UserService) Create(dto habitapi.CreateUserDTO) (*habitapi.User, error)
- func (s *UserService) Delete(id string) error
- func (s *UserService) GetById(id string) (*habitapi.User, error)
- func (s *UserService) List() ([]*habitapi.User, error)
- func (s *UserService) Update(id string, dto habitapi.UpdateUserDTO) (*habitapi.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Credential ¶
type DeedService ¶
func (*DeedService) Create ¶
func (s *DeedService) Create(dto habitapi.CreateDeedDTO) (*habitapi.Deed, error)
func (*DeedService) Delete ¶
func (s *DeedService) Delete(id string) error
func (*DeedService) Update ¶
func (s *DeedService) Update( id string, dto habitapi.UpdateDeedDTO, ) (*habitapi.Deed, error)
type HabitGroupService ¶
func (*HabitGroupService) Create ¶
func (s *HabitGroupService) Create(dto habitapi.CreateHabitGroupDTO) (*habitapi.HabitGroup, error)
func (*HabitGroupService) Delete ¶
func (s *HabitGroupService) Delete(id string) error
func (*HabitGroupService) GetById ¶
func (s *HabitGroupService) GetById(id string) (*habitapi.HabitGroup, error)
func (*HabitGroupService) List ¶
func (s *HabitGroupService) List() ([]*habitapi.HabitGroup, error)
func (*HabitGroupService) Update ¶
func (s *HabitGroupService) Update( id string, dto habitapi.UpdateHabitGroupDTO, ) (*habitapi.HabitGroup, error)
type HabitService ¶
func (*HabitService) Create ¶
func (s *HabitService) Create(dto habitapi.CreateHabitDTO) (*habitapi.Habit, error)
func (*HabitService) Delete ¶
func (s *HabitService) Delete(id string) error
func (*HabitService) Update ¶
func (s *HabitService) Update( id string, dto habitapi.UpdateHabitDTO, ) (*habitapi.Habit, error)
type RewardService ¶
func (*RewardService) Create ¶
func (s *RewardService) Create(dto habitapi.CreateRewardDTO) (*habitapi.Reward, error)
func (*RewardService) Delete ¶
func (s *RewardService) Delete(id string) error
func (*RewardService) GetById ¶
func (s *RewardService) GetById(id string) (*habitapi.Reward, error)
func (*RewardService) Update ¶
func (s *RewardService) Update( id string, dto habitapi.UpdateRewardDTO, ) (*habitapi.Reward, error)
type UserService ¶
func (*UserService) Create ¶
func (s *UserService) Create(dto habitapi.CreateUserDTO) (*habitapi.User, error)
func (*UserService) Delete ¶
func (s *UserService) Delete(id string) error
func (*UserService) Update ¶
func (s *UserService) Update( id string, dto habitapi.UpdateUserDTO, ) (*habitapi.User, error)
Click to show internal directories.
Click to hide internal directories.