Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidHabitTitle = app.Errorf(app.EINVALID, "Invalid habit title.")
Functions ¶
This section is empty.
Types ¶
type Habit ¶
type Habit struct {
Id HabitId `json:"id"`
Title HabitTitle `json:"title"`
Day time.Time `json:"day"`
IsCompleted bool `json:"is_completed"`
UpdatedAt time.Time `json:"updated_at"`
}
func CreateHabit ¶
func (*Habit) ChangeTitle ¶
func (*Habit) ToggleCompletion ¶
func (h *Habit) ToggleCompletion()
type HabitService ¶
type HabitService interface {
// All the habits for heat map
HeatMap(ctx context.Context, from time.Time, to time.Time) (map[time.Time]*HeatMap, int, error)
// Get all the habits for the given day
GetAllByDay(ctx context.Context, day time.Time) (*Chain, error)
Create(ctx context.Context, habit *Habit) error
// delete a habit
Delete(ctx context.Context, id HabitId) error
Update(ctx context.Context, habit *Habit) error
}
type HabitTitle ¶
type HabitTitle string
func CreateHabitTitle ¶
func CreateHabitTitle(title string) (HabitTitle, error)
func (HabitTitle) String ¶
func (ht HabitTitle) String() string
Click to show internal directories.
Click to hide internal directories.