listing

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayTasks

func DisplayTasks(kind string, data []Issue, version, date string) (string, error)

DisplayTasks display issues as table output

func ToArray

func ToArray(data []Issue) (s []string)

func ToIssue

func ToIssue(s []string) (iss []string)

Types

type BranchLite

type BranchLite struct {
	Owner      string `json:"owner"`
	Repository string `json:"repository"`
	Branch     string `json:"branch"`
}

type Changelog

type Changelog struct {
	Date    string `json:"date"`
	Version string `json:"version"`
	Bugs    []Lite `json:"bugs"`
	Tasks   []Lite `json:"tasks"`
}

type DevelopmentInfo

type DevelopmentInfo struct {
	Detail []struct {
		Branches []struct {
			Name                 string `json:"name"`
			URL                  string `json:"url"`
			CreatePullRequestURL string `json:"createPullRequestUrl"`
			Repository           struct {
				Name    string        `json:"name"`
				Avatar  string        `json:"avatar"`
				URL     string        `json:"url"`
				Commits []interface{} `json:"commits"`
			} `json:"repository"`
			LastCommit struct {
				ID              string        `json:"id"`
				DisplayID       string        `json:"displayId"`
				AuthorTimestamp string        `json:"authorTimestamp"`
				Merge           bool          `json:"merge"`
				Files           []interface{} `json:"files"`
			} `json:"lastCommit"`
		} `json:"branches"`
		PullRequests []struct {
			Author struct {
				Name   string `json:"name"`
				Avatar string `json:"avatar"`
			} `json:"author"`
			ID           string `json:"id"`
			Name         string `json:"name"`
			CommentCount int    `json:"commentCount"`
			Source       struct {
				Branch string `json:"branch"`
				URL    string `json:"url"`
			} `json:"source"`
			Destination struct {
				Branch string `json:"branch"`
				URL    string `json:"url"`
			} `json:"destination"`
			Reviewers  []interface{} `json:"reviewers"`
			Status     string        `json:"status"`
			URL        string        `json:"url"`
			LastUpdate string        `json:"lastUpdate"`
		} `json:"pullRequests"`
	} `json:"detail"`
}

type Issue

type Issue struct {
	jira.Issue
	DevelopmentInfo DevelopmentInfo `json:"development_info"`
}

Issue defines the properties of an issue to be listed

type Lite

type Lite struct {
	IssueKey string `json:"issue_key"`
	IssueURL string `json:"issue_url"`
	Summary  string `json:"summary"`
}

type Repository

type Repository interface {

	// GetIssue returns the issue with given issue keys.
	GetIssue(string) (Issue, error)

	// GetAllIssues returns all issues using jql.
	GetAllIssues(string, int, bool) ([]Issue, error)
}

Repository provides access to the beer and review storage.

type RepositoryChangelog

type RepositoryChangelog struct {
	Repository string
	Changelog  Changelog
}

type Service

type Service interface {
	GetIssue(string) (Issue, error)
	GetIssues(string, int, bool) ([]Issue, error)
}

Service provides beer and review listing operations.

func NewService

func NewService(r Repository) Service

NewService creates a listing service with the necessary dependencies

Jump to

Keyboard shortcuts

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