tracker

package
v0.3.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntervalCreateRetry  = time.Second * 30
	IntervalRefresh      = time.Second * 30
	IntervalConnected    = time.Second * 60
	IntervalDisconnected = time.Second * 10
)

Intervals

View Source
const (
	JiraCloud  = "jira-cloud"
	JiraOnPrem = "jira-onprem"
)

Tracker types

View Source
const (
	New        = "New"
	InProgress = "In Progress"
	Done       = "Done"
	Unknown    = "Unknown"
)

Ticket status

View Source
const (
	BearerAuth = "bearer"
	BasicAuth  = "basic-auth"
)

Auth kinds

View Source
const IssueTypeEpic = "Epic"

Variables

View Source
var (
	Log = logr.WithName("tickets")
)

Functions

This section is empty.

Types

type Connector

type Connector interface {
	// With updates the connector with the tracker model.
	With(t *model.Tracker)
	// Create a ticket in the external tracker.
	Create(t *model.Ticket) error
	// RefreshAll refreshes the status of all tickets.
	RefreshAll() (map[*model.Ticket]bool, error)
	// TestConnection to the external ticket tracker.
	TestConnection() (bool, error)
	// Projects lists the tracker's projects.
	Projects() ([]Project, error)
	// Project gets a project from the tracker.
	Project(id string) (Project, error)
	// IssueTypes gets the issue types for a project.
	IssueTypes(id string) ([]IssueType, error)
}

Connector is a connector for an external ticket tracker.

func NewConnector

func NewConnector(t *model.Tracker) (conn Connector, err error)

NewConnector instantiates a connector for an external ticket tracker.

type IssueType added in v0.2.0

type IssueType struct {
	ID   string
	Name string
}

IssueType represents a type of issue that can be created on an external issue tracker.

type JiraConnector added in v0.2.0

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

JiraConnector for the Jira Cloud API

func (*JiraConnector) Create added in v0.2.0

func (r *JiraConnector) Create(t *model.Ticket) (err error)

Create the ticket in Jira.

func (*JiraConnector) IssueTypes added in v0.2.0

func (r *JiraConnector) IssueTypes(id string) (issueTypes []IssueType, err error)

IssueTypes returns a list of IssueTypes for a Project.

func (*JiraConnector) Project added in v0.2.0

func (r *JiraConnector) Project(id string) (project Project, err error)

Project returns a Project.

func (*JiraConnector) Projects added in v0.2.0

func (r *JiraConnector) Projects() (projects []Project, err error)

Projects returns a list of Projects.

func (*JiraConnector) RefreshAll added in v0.2.0

func (r *JiraConnector) RefreshAll() (tickets map[*model.Ticket]bool, err error)

RefreshAll retrieves fresh status information for all the tracker's tickets.

func (*JiraConnector) TestConnection added in v0.2.0

func (r *JiraConnector) TestConnection() (connected bool, err error)

TestConnection to Jira Cloud.

func (*JiraConnector) With added in v0.2.0

func (r *JiraConnector) With(t *model.Tracker)

With updates the connector with the Tracker model.

type Manager

type Manager struct {
	// DB
	DB *gorm.DB
}

Manager provides ticket management.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run the manager.

type Project added in v0.2.0

type Project struct {
	ID   string
	Name string
}

Project represents an external ticket tracker's project in which an issue can be created.

Jump to

Keyboard shortcuts

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