domain

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package domain is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateWeekReport added in v0.0.13

func GenerateWeekReport(now time.Time, sessionService *SessionService) (*weekData, error)

GenerateWeekReport generates the data of the entire week in a tabular format

func HourAndMinuteFromString added in v0.0.11

func HourAndMinuteFromString(str string) (hour int, minute int, err error)

func PrintByDay added in v0.0.11

func PrintByDay(ss *SessionService, since time.Duration)

PrintByDay prints the data per day with items of each day in a table

func PrintWithTime added in v0.0.11

func PrintWithTime(ss *SessionService, since time.Duration)

func Score

func Score(challenge string) int

Score gives a 10 point when in flow, gives a 3 point when challenge is over the current skill level and 0 when challenge is under skill level.

func SortDays added in v0.0.12

func SortDays(queryData Days)

Types

type Day

type Day struct {
	Day      string
	Count    int
	Sessions []*Session
}

Day is a collection of sessions done in a day.

type Days

type Days []*Day

Days represents the work done in multiple days.

type MockSessionRepo

type MockSessionRepo struct {
	// contains filtered or unexported fields
}

MockSessionRepo is a mock of SessionRepo interface.

func NewMockSessionRepo

func NewMockSessionRepo(ctrl *gomock.Controller) *MockSessionRepo

NewMockSessionRepo creates a new mock instance.

func (*MockSessionRepo) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSessionRepo) Pop

func (m *MockSessionRepo) Pop()

Pop mocks base method.

func (*MockSessionRepo) Query added in v0.0.10

func (m *MockSessionRepo) Query(duration time.Duration) ([]*Session, error)

Query mocks base method.

func (*MockSessionRepo) Save

func (m *MockSessionRepo) Save(save *Session)

Save mocks base method.

type MockSessionRepoMockRecorder

type MockSessionRepoMockRecorder struct {
	// contains filtered or unexported fields
}

MockSessionRepoMockRecorder is the mock recorder for MockSessionRepo.

func (*MockSessionRepoMockRecorder) Pop

Pop indicates an expected call of Pop.

func (*MockSessionRepoMockRecorder) Query added in v0.0.10

func (mr *MockSessionRepoMockRecorder) Query(duration interface{}) *gomock.Call

Query indicates an expected call of Query.

func (*MockSessionRepoMockRecorder) Save

func (mr *MockSessionRepoMockRecorder) Save(save interface{}) *gomock.Call

Save indicates an expected call of Save.

type Session

type Session struct {
	Time      time.Time // Time when the item was done
	Challenge string    // Challenge is anxiety, flow or boredom
}

Session represents a single work session.

type SessionRepo

type SessionRepo interface {
	// Save a session
	Save(save *Session)

	// Query pulls the session items from daysBack number of days to current date inclusive.
	Query(duration time.Duration) ([]*Session, error)

	// Pop the last session added
	Pop()
}

type SessionService

type SessionService struct {
	// contains filtered or unexported fields
}

func NewSessionService

func NewSessionService(repo SessionRepo) *SessionService

func (*SessionService) Pop

func (s *SessionService) Pop()

func (*SessionService) ReportForPreviousDays added in v0.0.10

func (s *SessionService) ReportForPreviousDays(daysBack time.Duration) (Days, error)

func (*SessionService) Save

func (s *SessionService) Save(item *Session) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL