storage

package
v0.0.0-...-46b8622 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package storage provide API to access database

Index

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

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

CreatePlanning create new planning and new planned time

func (*PlanningStorage) LastActivity

func (p *PlanningStorage) LastActivity(_ context.Context, uid ctxtg.UserID) (int64, error)

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

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

Jump to

Keyboard shortcuts

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