Documentation ¶
Index ¶
- type FileProjectStorage
- type FileUserSessionManager
- type FoodEntry
- type FoodTrackingService
- type ProductiveService
- func (s *ProductiveService) CreateFoodTimeEntry(entry FoodEntry, sessionData *UserSessionData) error
- func (s *ProductiveService) CreateProjectTimeEntry(entry ProjectEntry, sessionData *UserSessionData) error
- func (s *ProductiveService) FindDeals(dealQuery string, day time.Time, sessionData *UserSessionData) ([]productive.Deal, error)
- func (s *ProductiveService) FindFoodService(day time.Time, sessionData *UserSessionData) (*productive.Service, error)
- func (s *ProductiveService) FindSavedProject(project *TrackedProject, day time.Time, sessionData *UserSessionData) *TrackedProject
- func (s *ProductiveService) FindServices(serviceQuery string, deal *productive.Deal, day time.Time, ...) ([]productive.Service, error)
- func (s *ProductiveService) GetOrganizationMemberships(sessionData *UserSessionData) ([]productive.OrganizationMembership, error)
- func (s *ProductiveService) Login(username string, password string) (*productive.SessionResponse, error)
- func (s *ProductiveService) ValidateSession(otp string, password string, sessionResponse *productive.SessionResponse) (*productive.SessionResponse, error)
- type ProjectEntry
- type ProjectStorage
- type ProjectTrackingService
- type Prompt
- type SessionService
- type StdinPrompt
- func (stdIn StdinPrompt) Input(label string) (string, error)
- func (stdIn StdinPrompt) InputMasked(label string) (string, error)
- func (stdIn StdinPrompt) InputMultiline(label string) ([]string, error)
- func (stdIn StdinPrompt) SelectDeal(label string, deals []productive.Deal) (*productive.Deal, error)
- func (stdIn StdinPrompt) SelectOneWithSearch(label string, options []TrackedProject, searchFunction func(string, int) bool) (interface{}, error)
- func (stdIn StdinPrompt) SelectService(label string, services []productive.Service) (*productive.Service, error)
- type TrackFoodRequest
- type TrackProjectRequest
- type TrackedProject
- type TrackedProjects
- type UserSessionData
- type UserSessionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileProjectStorage ¶
type FileProjectStorage struct{}
func NewFileProjectStorage ¶
func NewFileProjectStorage() *FileProjectStorage
func (FileProjectStorage) GetTrackedProjects ¶
func (f FileProjectStorage) GetTrackedProjects() ([]TrackedProject, error)
func (FileProjectStorage) UpsertTrackedProject ¶
func (f FileProjectStorage) UpsertTrackedProject(project TrackedProject) error
type FileUserSessionManager ¶
type FileUserSessionManager struct{}
func NewFileUserSessionManager ¶
func NewFileUserSessionManager() *FileUserSessionManager
func (*FileUserSessionManager) GetUserSession ¶
func (f *FileUserSessionManager) GetUserSession() (*UserSessionData, error)
func (*FileUserSessionManager) SaveUserSession ¶
func (f *FileUserSessionManager) SaveUserSession(session UserSessionData) error
type FoodTrackingService ¶
type FoodTrackingService struct {
// contains filtered or unexported fields
}
func NewFoodTrackingService ¶
func NewFoodTrackingService(productiveClient *productive.Client) *FoodTrackingService
func (*FoodTrackingService) TrackFood ¶
func (s *FoodTrackingService) TrackFood(request TrackFoodRequest) error
type ProductiveService ¶
type ProductiveService struct {
// contains filtered or unexported fields
}
func NewProductiveService ¶
func NewProductiveService(client *productive.Client) *ProductiveService
func (*ProductiveService) CreateFoodTimeEntry ¶
func (s *ProductiveService) CreateFoodTimeEntry(entry FoodEntry, sessionData *UserSessionData) error
func (*ProductiveService) CreateProjectTimeEntry ¶
func (s *ProductiveService) CreateProjectTimeEntry(entry ProjectEntry, sessionData *UserSessionData) error
func (*ProductiveService) FindDeals ¶
func (s *ProductiveService) FindDeals(dealQuery string, day time.Time, sessionData *UserSessionData) ([]productive.Deal, error)
func (*ProductiveService) FindFoodService ¶
func (s *ProductiveService) FindFoodService(day time.Time, sessionData *UserSessionData) (*productive.Service, error)
func (*ProductiveService) FindSavedProject ¶
func (s *ProductiveService) FindSavedProject(project *TrackedProject, day time.Time, sessionData *UserSessionData) *TrackedProject
func (*ProductiveService) FindServices ¶
func (s *ProductiveService) FindServices(serviceQuery string, deal *productive.Deal, day time.Time, sessionData *UserSessionData) ([]productive.Service, error)
func (*ProductiveService) GetOrganizationMemberships ¶ added in v0.0.3
func (s *ProductiveService) GetOrganizationMemberships(sessionData *UserSessionData) ([]productive.OrganizationMembership, error)
func (*ProductiveService) Login ¶ added in v0.0.3
func (s *ProductiveService) Login(username string, password string) (*productive.SessionResponse, error)
func (*ProductiveService) ValidateSession ¶ added in v0.0.3
func (s *ProductiveService) ValidateSession(otp string, password string, sessionResponse *productive.SessionResponse) (*productive.SessionResponse, error)
type ProjectEntry ¶
type ProjectStorage ¶
type ProjectStorage interface { UpsertTrackedProject(project TrackedProject) error GetTrackedProjects() ([]TrackedProject, error) }
type ProjectTrackingService ¶
type ProjectTrackingService struct {
// contains filtered or unexported fields
}
func NewProjectTrackingService ¶
func NewProjectTrackingService(client *productive.Client) *ProjectTrackingService
func (*ProjectTrackingService) TrackProject ¶
func (s *ProjectTrackingService) TrackProject(request TrackProjectRequest) error
type Prompt ¶
type Prompt interface { Input(label string) (string, error) InputMasked(label string) (string, error) InputMultiline(label string) ([]string, error) SelectDeal(label string, deals []productive.Deal) (*productive.Deal, error) SelectService(label string, services []productive.Service) (*productive.Service, error) SelectOneWithSearch(label string, options []TrackedProject, searchFunction func(string, int) bool) (interface{}, error) }
type SessionService ¶
type SessionService struct {
// contains filtered or unexported fields
}
func NewSessionService ¶
func NewSessionService( productiveService *ProductiveService, prompt Prompt, sessionManager UserSessionManager, ) *SessionService
func (*SessionService) ObtainUserSession ¶ added in v0.0.3
func (s *SessionService) ObtainUserSession() (*UserSessionData, error)
type StdinPrompt ¶
type StdinPrompt struct{}
func NewStdinPrompt ¶
func NewStdinPrompt() StdinPrompt
func (StdinPrompt) InputMasked ¶
func (stdIn StdinPrompt) InputMasked(label string) (string, error)
func (StdinPrompt) InputMultiline ¶
func (stdIn StdinPrompt) InputMultiline(label string) ([]string, error)
func (StdinPrompt) SelectDeal ¶
func (stdIn StdinPrompt) SelectDeal(label string, deals []productive.Deal) (*productive.Deal, error)
func (StdinPrompt) SelectOneWithSearch ¶
func (stdIn StdinPrompt) SelectOneWithSearch( label string, options []TrackedProject, searchFunction func(string, int) bool, ) (interface{}, error)
func (StdinPrompt) SelectService ¶
func (stdIn StdinPrompt) SelectService(label string, services []productive.Service) (*productive.Service, error)
type TrackFoodRequest ¶
func (TrackFoodRequest) IsValid ¶
func (trackFoodRequest TrackFoodRequest) IsValid() bool
type TrackProjectRequest ¶
type TrackProjectRequest struct {
Day string
}
type TrackedProject ¶
type TrackedProjects ¶
type TrackedProjects struct {
Projects []TrackedProject `json:"projects,omitempty"`
}
type UserSessionData ¶
type UserSessionManager ¶
type UserSessionManager interface { GetUserSession() (*UserSessionData, error) SaveUserSession(session UserSessionData) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.