Documentation ¶
Overview ¶
Package storage provide API to access database
Index ¶
- type PlanningStorage
- func (p *PlanningStorage) AddExtraTime(_ context.Context, uid ctxtg.UserID, np entities.PlannedTime) error
- func (p *PlanningStorage) AddSpentTime(_ context.Context, h entities.SpentTimeHistory) error
- func (p *PlanningStorage) ClosePlanning(_ context.Context, uid ctxtg.UserID, report entities.PlanningReport) error
- func (p *PlanningStorage) CreatePlanning(_ context.Context, np entities.NewPlanning) (entities.PlanningID, error)
- func (p *PlanningStorage) LastActivity(_ context.Context, uid ctxtg.UserID) (int64, error)
- func (p *PlanningStorage) OpenedPlannings(_ context.Context, uid ctxtg.UserID) ([]entities.ExtendedPlanning, error)
- func (p *PlanningStorage) Planning(_ context.Context, pid entities.PlanningID) (*entities.Planning, error)
- func (p *PlanningStorage) PlanningCreatedAt(_ context.Context, pid entities.PlanningID) (int64, error)
- func (p *PlanningStorage) SpentTimeByUserIDTimeRange(ctx context.Context, uid ctxtg.UserID, from, to int64) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlanningStorage ¶
type PlanningStorage struct {
// contains filtered or unexported fields
}
PlanningStorage provide needed operations on plannings
func NewPlanningStorage ¶
func NewPlanningStorage(db *sqlx.DB, sharedLock time.Duration) *PlanningStorage
NewPlanningStorage setups and created PlanningStorage
func (*PlanningStorage) AddExtraTime ¶
func (p *PlanningStorage) AddExtraTime(_ context.Context, uid ctxtg.UserID, np entities.PlannedTime) error
AddExtraTime create new estimation for planning
func (*PlanningStorage) AddSpentTime ¶
func (p *PlanningStorage) AddSpentTime(_ context.Context, h entities.SpentTimeHistory) error
AddSpentTime save new SpentTimeHistory
func (*PlanningStorage) ClosePlanning ¶
func (p *PlanningStorage) ClosePlanning(_ context.Context, uid ctxtg.UserID, report entities.PlanningReport) error
ClosePlanning check user id, save history and update planning
func (*PlanningStorage) CreatePlanning ¶
func (p *PlanningStorage) CreatePlanning(_ context.Context, np entities.NewPlanning) (entities.PlanningID, error)
CreatePlanning create new planning and new planned time
func (*PlanningStorage) LastActivity ¶
LastActivity for user id
func (*PlanningStorage) OpenedPlannings ¶
func (p *PlanningStorage) OpenedPlannings(_ context.Context, uid ctxtg.UserID) ([]entities.ExtendedPlanning, error)
OpenedPlannings returned all opened plannings for uid
func (*PlanningStorage) Planning ¶
func (p *PlanningStorage) Planning(_ context.Context, pid entities.PlanningID) (*entities.Planning, error)
Planning return planning by pid
func (*PlanningStorage) PlanningCreatedAt ¶
func (p *PlanningStorage) PlanningCreatedAt(_ context.Context, pid entities.PlanningID) (int64, error)
PlanningCreatedAt returns createdAt field for pid
func (*PlanningStorage) SpentTimeByUserIDTimeRange ¶
func (p *PlanningStorage) SpentTimeByUserIDTimeRange(ctx context.Context, uid ctxtg.UserID, from, to int64) (int, error)
SpentTimeByUserIDTimeRange return total spent time for user for time range
Click to show internal directories.
Click to hide internal directories.