rdb

package
v0.0.0-...-3e85c3f Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToContext

func ToContext(c context.Context, store Store) context.Context

ToContext adds the Store to this context if it supports the Setter interface.

Types

type ContextKey

type ContextKey string

type Store

type Store interface {
	// GetProject creates a new project.
	GetProject(UUID uuid.UUID) (*models.Project, error)
	// CreateProject creates a new project.
	CreateProject(*models.Project) error
	// GetProjects gets all projects.
	GetProjects() ([]models.Project, error)
	// GetDuration gets all durations in that day, that project and that branches.
	// user: required.
	// day: required. Durations will be returned from 12am until 11:59pm in user's timezone for this day.
	// project: optional. nil means all projects.
	// branches: optional. nil means all branches. empty array means no branches (and empty result).
	GetDurations(user string, date time.Time, project string, branches []string) ([]models.StoredDuration, error)
	//CreateStat saves a stat.
	CreateStat(*models.Stat) error
}

Store is the interface of data store.

func FromContext

func FromContext(c context.Context) Store

FromContext returns the Store associated with this context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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