data

package
v4.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentLoginName

func CurrentLoginName() (string, error)

func IsConclusionAFailure

func IsConclusionAFailure(conclusion string) bool

func IsStatusWaiting

func IsStatusWaiting(status string) bool

Types

type Assignee

type Assignee struct {
	Login string
}

type Assignees

type Assignees struct {
	Nodes []Assignee
}

type CheckRun

type CheckRun struct {
	Name       graphql.String
	Status     graphql.String
	Conclusion graphql.String
	CheckSuite struct {
		Creator struct {
			Login graphql.String
		}
		WorkflowRun struct {
			Workflow struct {
				Name graphql.String
			}
		}
	}
}

type Comment

type Comment struct {
	Author struct {
		Login string
	}
	Body      string
	UpdatedAt time.Time
}

type Comments

type Comments struct {
	Nodes      []Comment
	TotalCount int
}

type Commits

type Commits struct {
	Nodes []struct {
		Commit struct {
			Deployments struct {
				Nodes []struct {
					Task        graphql.String
					Description graphql.String
				}
			} `graphql:"deployments(last: 10)"`
			StatusCheckRollup struct {
				Contexts struct {
					TotalCount graphql.Int
					Nodes      []struct {
						Typename      graphql.String `graphql:"__typename"`
						CheckRun      CheckRun       `graphql:"... on CheckRun"`
						StatusContext StatusContext  `graphql:"... on StatusContext"`
					}
				} `graphql:"contexts(last: 20)"`
			}
		}
	}
}

type IssueComment

type IssueComment struct {
	Author struct {
		Login string
	}
	Body      string
	UpdatedAt time.Time
}

type IssueComments

type IssueComments struct {
	Nodes      []IssueComment
	TotalCount int
}

type IssueData

type IssueData struct {
	Number int
	Title  string
	Body   string
	State  string
	Author struct {
		Login string
	}
	UpdatedAt  time.Time
	Url        string
	Repository Repository
	Assignees  Assignees      `graphql:"assignees(first: 3)"`
	Comments   IssueComments  `graphql:"comments(first: 15)"`
	Reactions  IssueReactions `graphql:"reactions(first: 1)"`
	Labels     IssueLabels    `graphql:"labels(first: 3)"`
}

func (IssueData) GetNumber

func (data IssueData) GetNumber() int

func (IssueData) GetRepoNameWithOwner

func (data IssueData) GetRepoNameWithOwner() string

func (IssueData) GetTitle

func (data IssueData) GetTitle() string

func (IssueData) GetUpdatedAt

func (data IssueData) GetUpdatedAt() time.Time

func (IssueData) GetUrl

func (data IssueData) GetUrl() string

type IssueLabels

type IssueLabels struct {
	Nodes []Label
}

type IssueReactions

type IssueReactions struct {
	TotalCount int
}

type IssuesResponse

type IssuesResponse struct {
	Issues     []IssueData
	TotalCount int
	PageInfo   PageInfo
}

func FetchIssues

func FetchIssues(query string, limit int, pageInfo *PageInfo) (IssuesResponse, error)

type Label

type Label struct {
	Color string
	Name  string
}

type PRLabel

type PRLabel struct {
	Color string
	Name  string
}

type PRLabels

type PRLabels struct {
	Nodes []Label
}

type PageInfo

type PageInfo struct {
	HasNextPage bool
	StartCursor string
	EndCursor   string
}

type PullRequestData

type PullRequestData struct {
	Number int
	Title  string
	Body   string
	Author struct {
		Login string
	}
	UpdatedAt      time.Time
	Url            string
	State          string
	Mergeable      string
	ReviewDecision string
	Additions      int
	Deletions      int
	HeadRefName    string
	BaseRefName    string
	HeadRepository struct {
		Name string
	}
	HeadRef struct {
		Name string
	}
	Repository    Repository
	Assignees     Assignees     `graphql:"assignees(first: 3)"`
	Comments      Comments      `graphql:"comments(last: 5, orderBy: { field: UPDATED_AT, direction: DESC })"`
	LatestReviews Reviews       `graphql:"latestReviews(last: 3)"`
	ReviewThreads ReviewThreads `graphql:"reviewThreads(last: 20)"`
	IsDraft       bool
	Commits       Commits  `graphql:"commits(last: 1)"`
	Labels        PRLabels `graphql:"labels(first: 3)"`
}

func FetchPullRequest

func FetchPullRequest(prUrl string) (PullRequestData, error)

func (PullRequestData) GetNumber

func (data PullRequestData) GetNumber() int

func (PullRequestData) GetRepoNameWithOwner

func (data PullRequestData) GetRepoNameWithOwner() string

func (PullRequestData) GetTitle

func (data PullRequestData) GetTitle() string

func (PullRequestData) GetUpdatedAt

func (data PullRequestData) GetUpdatedAt() time.Time

func (PullRequestData) GetUrl

func (data PullRequestData) GetUrl() string

type PullRequestsResponse

type PullRequestsResponse struct {
	Prs        []PullRequestData
	TotalCount int
	PageInfo   PageInfo
}

func FetchPullRequests

func FetchPullRequests(query string, limit int, pageInfo *PageInfo) (PullRequestsResponse, error)

type Repository

type Repository struct {
	Name          string
	NameWithOwner string
	IsArchived    bool
}

type Review

type Review struct {
	Author struct {
		Login string
	}
	Body      string
	State     string
	UpdatedAt time.Time
}

type ReviewComment

type ReviewComment struct {
	Author struct {
		Login string
	}
	Body      string
	UpdatedAt time.Time
	StartLine int
	Line      int
}

type ReviewComments

type ReviewComments struct {
	Nodes      []ReviewComment
	TotalCount int
}

type ReviewThreads

type ReviewThreads struct {
	Nodes []struct {
		Id           string
		IsOutdated   bool
		OriginalLine int
		StartLine    int
		Line         int
		Path         string
		Comments     ReviewComments `graphql:"comments(first: 10)"`
	}
}

type Reviews

type Reviews struct {
	Nodes []Review
}

type RowData

type RowData interface {
	GetRepoNameWithOwner() string
	GetTitle() string
	GetNumber() int
	GetUrl() string
	GetUpdatedAt() time.Time
}

type StatusContext

type StatusContext struct {
	Context graphql.String
	State   graphql.String
	Creator struct {
		Login graphql.String
	}
}

Jump to

Keyboard shortcuts

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