cache

package
v0.0.0-...-0e93b89 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CreateEventsTableSQL = `` /* 247-byte string literal not displayed */
View Source
const CreateIssuesTableSQL = `` /* 403-byte string literal not displayed */

Variables

View Source
var EventColumns = []string{"key", "author", "date", "field", "[from]", "[to]"}
View Source
var IssueColumns = []string{"key", "url", "type", "status", "resolution", "summary", "labels", "creator", "created", "updated", "daysopen"}

Functions

func EventColumnsPlaceholders

func EventColumnsPlaceholders() string

func EventColumnsString

func EventColumnsString() string

func IssueColumnsPlaceholders

func IssueColumnsPlaceholders() string

func IssueColumnsString

func IssueColumnsString() string

Types

type Cache

type Cache struct {
	Path string
	DB   *sql.DB
}

func Open

func Open(path string) (*Cache, error)

func (Cache) GetAllEvents

func (cache Cache) GetAllEvents() ([]Event, error)

func (Cache) GetAllIssues

func (cache Cache) GetAllIssues() (*[]Issue, error)

func (Cache) GetIssue

func (cache Cache) GetIssue(key string) (*Issue, error)

func (Cache) GetIssueEventsForField

func (cache Cache) GetIssueEventsForField(key, field string) ([]Event, error)

func (Cache) GetIssuesCreatedInDateRange

func (cache Cache) GetIssuesCreatedInDateRange(from, to time.Time) (*[]Issue, error)

func (Cache) QueryForEvents

func (cache Cache) QueryForEvents(qfmt string, a ...any) ([]Event, error)

func (Cache) QueryForIssues

func (cache Cache) QueryForIssues(qfmt string, a ...any) (*[]Issue, error)

func (Cache) UpsertEventsFromIssue

func (cache Cache) UpsertEventsFromIssue(issue *models.IssueScheme) (*int, error)

func (Cache) UpsertIssueFromJIRA

func (cache Cache) UpsertIssueFromJIRA(issue *models.IssueScheme) error

type Event

type Event struct {
	Key    string
	Author string
	Date   time.Time
	Field  string
	From   string
	To     string
}

type Issue

type Issue struct {
	Key string
	URL string

	Type   string
	Status string
	// Sprint     string // do we bother with this? it is an internal process thing
	Resolution string

	Summery string
	Labels  []string

	Creator string
	Created time.Time
	Updated time.Time

	// calculated
	DaysOpen sql.NullFloat64
	Closed   time.Time // todo, need to parse events to get this
}

func (Issue) IsCLosed

func (i Issue) IsCLosed() bool

Jump to

Keyboard shortcuts

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