model

package
v0.0.0-...-b5a03d5 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IssueStateOpen describe the opened status
	IssueStateOpen = "open"
	// IssueStatusClosed describe the closed status
	IssueStatusClosed = "closed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Owner   string
	Repo    string
	Name    string
	HTMLURL string
}

Branch describe the github branch

func ConvertBranch

func ConvertBranch(owner string, repo string, branch *github.Branch) Branch

ConvertBranch convert github.Branch to Branch

type Issue

type Issue struct {
	Number    int
	Title     string
	State     string
	HTMLURL   string
	Reporter  string
	CreatedAt time.Time
	ClosedAt  time.Time

	IsPullRequest bool
}

Issue describe the github issue.

func ConvertIssue

func ConvertIssue(issue *github.Issue) Issue

ConvertIssue convert github.Issue to Issue

func ConvertIssues

func ConvertIssues(issues []*github.Issue) []Issue

ConvertIssues convert array of github.Issue to array of Issue

func (Issue) GetItemSubtitle

func (i Issue) GetItemSubtitle() string

GetItemSubtitle return the subtitle text for alfred item.

func (Issue) GetItemTitle

func (i Issue) GetItemTitle() string

GetItemTitle return the title text for alfred item.

type Milestone

type Milestone struct {
	Description  string
	HTMLURL      string
	Title        string
	State        string
	DueOn        time.Time
	ClosedAt     time.Time
	OpenIssues   int
	ClosedIssues int
}

Milestone describe the github milestone.

func ConvertMilestones

func ConvertMilestones(milestones []*github.Milestone) []Milestone

ConvertMilestones convert github.Milestone to Milestone.

func (Milestone) GetItemSubtitle

func (m Milestone) GetItemSubtitle() string

GetItemSubtitle return the subtitle string.

func (Milestone) GetItemTitle

func (m Milestone) GetItemTitle() string

GetItemTitle return title string

func (Milestone) GetProgress

func (m Milestone) GetProgress() float64

GetProgress return the progress of the milestone

type Project

type Project struct {
	Name string
	URL  string
}

Project describe the github project.

func ConvertProjects

func ConvertProjects(projects []*github.Project) []Project

ConvertProjects convert github.Project to Project

type PullRequest

type PullRequest struct {
	Number    int
	State     string
	Title     string
	HTMLURL   string
	User      string
	MergedBy  string
	CreatedAt time.Time
	ClosedAt  time.Time
	MergedAt  time.Time
}

PullRequest describe the github pull request.

func ConvertPullRequests

func ConvertPullRequests(pulls []*github.PullRequest) []PullRequest

ConvertPullRequests convert github.PullRequest to PullRequest

func (PullRequest) GetItemSubtitle

func (pull PullRequest) GetItemSubtitle() string

GetItemSubtitle return a subtitle string.

func (PullRequest) GetItemTitle

func (pull PullRequest) GetItemTitle() string

GetItemTitle return a title string.

type Release

type Release struct {
	Author      string           `json:"author"`
	Name        string           `json:"name"`
	Draft       bool             `json:"draft"`
	Prerelease  bool             `json:"prerelease"`
	HTMLURL     string           `json:"html_url"`
	CreatedAt   github.Timestamp `json:"created_at"`
	PublishedAt github.Timestamp `json:"published_at"`
}

func ConvertRelease

func ConvertRelease(rel *github.RepositoryRelease) Release

func ConvertReleases

func ConvertReleases(rels []*github.RepositoryRelease) []Release

func (Release) Subtitle

func (m Release) Subtitle() string

type Repo

type Repo struct {
	Owner       string `json:"owner"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	HTMLURL     string `json:"html_url"`
}

Repo describe the github repository.

func ConvertRepo

func ConvertRepo(repo *github.Repository) Repo

func ConvertRepos

func ConvertRepos(repos []*github.Repository) []Repo

ConvertRepos convert the github.Repository to Repo.

func (Repo) BranchURL

func (repo Repo) BranchURL() string

func (Repo) CloneURL

func (repo Repo) CloneURL() string

func (Repo) InsightsURL

func (repo Repo) InsightsURL() string

func (Repo) IssuesURL

func (repo Repo) IssuesURL() string

func (Repo) MilestoneURL

func (repo Repo) MilestoneURL() string

func (Repo) ProjectsURL

func (repo Repo) ProjectsURL() string

func (Repo) PullsURL

func (repo Repo) PullsURL() string

func (Repo) ReleasesURL

func (repo Repo) ReleasesURL() string

func (Repo) SecurityURL

func (repo Repo) SecurityURL() string

func (Repo) SettingsURL

func (repo Repo) SettingsURL() string

func (Repo) WikiURL

func (repo Repo) WikiURL() string

type User

type User struct {
	Login   string
	HTMLURL string
}

User describe a github user.

func ConvertUser

func ConvertUser(user *github.User) User

ConvertUser convert github.User to User

func (User) IsValid

func (u User) IsValid() bool

Jump to

Keyboard shortcuts

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