Documentation
¶
Index ¶
- Variables
- func NewHabitService(db *DB) models.HabitService
- func SeedTestData(ctx context.Context, db *DB, year int, month time.Month)
- type DB
- type HabitServiceImpl
- func (s *HabitServiceImpl) Create(ctx context.Context, habit *models.Habit) error
- func (s *HabitServiceImpl) Delete(ctx context.Context, id models.HabitId) error
- func (s *HabitServiceImpl) GetAllByDay(ctx context.Context, day time.Time) (*models.Chain, error)
- func (s *HabitServiceImpl) HeatMap(ctx context.Context, from time.Time, to time.Time) (map[time.Time]*models.HeatMap, int, error)
- func (s *HabitServiceImpl) Update(ctx context.Context, habit *models.Habit) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHabitNotFound = app.Errorf(app.ENOTFOUND, "Habit not found.")
Functions ¶
func NewHabitService ¶
func NewHabitService(db *DB) models.HabitService
Types ¶
type DB ¶
type DB struct {
// Datasource name.
DSN string
// contains filtered or unexported fields
}
DB represents the database connection.
func SetupTestDB ¶
type HabitServiceImpl ¶
type HabitServiceImpl struct {
// contains filtered or unexported fields
}
func (*HabitServiceImpl) GetAllByDay ¶
Click to show internal directories.
Click to hide internal directories.