Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { LoadDay(d *time.Time) *WorkingDay Insert(wd WorkingDay) UpdateDay(wd WorkingDay) Delete(wd WorkingDay) Overtime() int ListRange(start *time.Time, end *time.Time) ([]WorkingDay, error) }
Repo is an interface for storing working days
type SqlRepo ¶
type SqlRepo struct {
// contains filtered or unexported fields
}
SqlRepo represents a DB access layer
func (*SqlRepo) Delete ¶
func (r *SqlRepo) Delete(wd WorkingDay)
Delete removes a working day from the database
func (*SqlRepo) Insert ¶
func (r *SqlRepo) Insert(wd WorkingDay)
Insert adds a new working day to the database
func (*SqlRepo) LoadDay ¶
func (r *SqlRepo) LoadDay(d *time.Time) *WorkingDay
LoadDay finds the matching working time entry for a specific date.
func (*SqlRepo) UpdateDay ¶
func (r *SqlRepo) UpdateDay(wd WorkingDay)
UpdateDay updates the values of a working day in the database
type WorkingDay ¶
type WorkingDay struct { gorm.Model Start time.Time End time.Time Brk int `gorm:"column:break_in_m"` Note string }
WorkingDay represents one day of work
func (*WorkingDay) String ¶
func (wd *WorkingDay) String() string
func (*WorkingDay) ToRow ¶
func (wd *WorkingDay) ToRow() table.Row
Click to show internal directories.
Click to hide internal directories.