repository

package
v0.2.1-0...-0cc80b3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

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

BoltDB is a repository with BoltDB as the backend

func NewBoltDBRepo

func NewBoltDBRepo(dbfile string) (*BoltDB, error)

NewBoltDBRepo will create a new BoltDB repository

func (*BoltDB) AllIssues

func (r *BoltDB) AllIssues() ([]types.ParentIssue, error)

AllIssues will return all of the issues from boltDB

func (*BoltDB) AllWorkLogs

func (r *BoltDB) AllWorkLogs() ([]types.WorklogItem, error)

AllWorkLogs will return all of the work logs from boltDB

func (*BoltDB) Close

func (r *BoltDB) Close()

Close will close the boltDB connection

func (*BoltDB) IssueAccuracy

func (r *BoltDB) IssueAccuracy(start time.Time, stop time.Time) ([]types.IssueAccuracy, error)

func (*BoltDB) IssuesGroupedBy

func (r *BoltDB) IssuesGroupedBy(groupBy string, start time.Time, stop time.Time) ([]types.IssueChartData, error)

IssuesGroupedBy will return issues group by the given groupBy value going back weeksBack. This data will be used for charting

func (*BoltDB) NonResolvedIssues

func (r *BoltDB) NonResolvedIssues() ([]types.ParentIssue, error)

NonResolvedIssues gets all issue keys that are not resolved yet

func (*BoltDB) UpdateIssue

func (r *BoltDB) UpdateIssue(issue *types.ParentIssue) error

UpdateIssue will update the resolved information for the given issue

func (*BoltDB) WorklogsGroupBy

func (r *BoltDB) WorklogsGroupBy(groupBy string, start time.Time, stop time.Time) ([]types.WorklogGroupByChart, error)

func (*BoltDB) WorklogsPerDev

func (r *BoltDB) WorklogsPerDev(start time.Time, stop time.Time) ([]map[string]string, error)

func (*BoltDB) WorklogsPerDevWeek

func (r *BoltDB) WorklogsPerDevWeek() ([]types.WorklogsPerDevWeek, error)

func (*BoltDB) Write

func (r *BoltDB) Write(wi *types.WorklogItem, pi *types.ParentIssue) error

Write will add the worklogItem to BoltDB

type Repo

type Repo interface {
	Write(w *types.WorklogItem, pi *types.ParentIssue) error
	NonResolvedIssues() ([]types.ParentIssue, error)
	//UpdateResolutionDate(issueKey string, resolvedDate time.Time) error
	UpdateIssue(*types.ParentIssue) error
	Close()

	AllIssues() ([]types.ParentIssue, error)
	IssuesGroupedBy(groupBy string, start time.Time, stop time.Time) ([]types.IssueChartData, error)
	IssueAccuracy(start time.Time, stop time.Time) ([]types.IssueAccuracy, error)

	AllWorkLogs() ([]types.WorklogItem, error)
	WorklogsGroupBy(groupBy string, start time.Time, stop time.Time) ([]types.WorklogGroupByChart, error)
	WorklogsPerDev(start time.Time, stop time.Time) ([]map[string]string, error)
	WorklogsPerDevWeek() ([]types.WorklogsPerDevWeek, error)
}

Repo is the interface that handles writing Jira Worklog items

type SQL

type SQL struct {
	DB *sqlx.DB
}

SQL is the SQL Server repository

func NewSQLRepo

func NewSQLRepo(cfg *jiraworklog.Config) (*SQL, error)

NewSQLRepo will create a new repository using a SQL database as storage

func (*SQL) AllIssues

func (s *SQL) AllIssues() ([]types.ParentIssue, error)

AllIssues will return all issues from SQL server

func (*SQL) AllWorkLogs

func (s *SQL) AllWorkLogs() ([]types.WorklogItem, error)

AllWorkLogs will return all of the work logs from SQL server

func (*SQL) Close

func (s *SQL) Close()

Close will close the database connection

func (*SQL) IssueAccuracy

func (s *SQL) IssueAccuracy(start time.Time, stop time.Time) ([]types.IssueAccuracy, error)

IssueAccuracy will return how accurate a developers estimate is vs actual time logged

func (*SQL) IssuesGroupedBy

func (s *SQL) IssuesGroupedBy(groupBy string, start time.Time, stop time.Time) ([]types.IssueChartData, error)

IssuesGroupedBy will return issues group by the given groupBy value going back daysBack. This data will be used for charting

func (*SQL) NonResolvedIssues

func (s *SQL) NonResolvedIssues() ([]types.ParentIssue, error)

NonResolvedIssues gets all issue keys that are not resolved yet

func (*SQL) UpdateIssue

func (s *SQL) UpdateIssue(issue *types.ParentIssue) error

UpdateIssue will update the resolved information for the given issue

func (*SQL) WorklogsGroupBy

func (s *SQL) WorklogsGroupBy(groupBy string, start time.Time, stop time.Time) ([]types.WorklogGroupByChart, error)

func (*SQL) WorklogsPerDev

func (s *SQL) WorklogsPerDev(start time.Time, stop time.Time) ([]map[string]string, error)

func (*SQL) WorklogsPerDevWeek

func (s *SQL) WorklogsPerDevWeek() ([]types.WorklogsPerDevWeek, error)

func (*SQL) Write

func (s *SQL) Write(w *types.WorklogItem, pi *types.ParentIssue) error

Write will add the worklogItem to SQL server

Jump to

Keyboard shortcuts

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