github

package
v0.0.0-...-33fbd0c Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupIssuesUrl

func CleanupIssuesUrl(urlString string) string

func CleanupPullsUrl

func CleanupPullsUrl(urlString string) string

func OrganizationInfoUrl

func OrganizationInfoUrl(orgName string) (*url.URL, error)

func OrganizationReposUrl

func OrganizationReposUrl(orgName string) (*url.URL, error)

func PullsUrl

func PullsUrl(user string, repo string) (*url.URL, error)

Types

type Client

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

func NewClient

func NewClient(client *http.Client, personalAccessToken string) *Client

func (*Client) Issues

func (c *Client) Issues(url *url.URL) ([]IssuesInfo, error)

func (*Client) OrganizationInfo

func (c *Client) OrganizationInfo(url *url.URL) (OrganizationInfo, error)

func (*Client) OrganizationRepos

func (c *Client) OrganizationRepos(u *url.URL) ([]OrganizationRepoInfo, error)

func (*Client) Pulls

func (c *Client) Pulls(url *url.URL) ([]Pull, error)

type GitHub

type GitHub interface {
	Issues(url *url.URL) ([]IssuesInfo, error)
	OrganizationInfo(url *url.URL) (OrganizationInfo, error)
	OrganizationRepos(url *url.URL) ([]OrganizationRepoInfo, error)
	Pulls(url *url.URL) ([]Pull, error)
}

type GithubErrorResponse

type GithubErrorResponse struct {
	Message          string `json:"message"`
	DocumentationURL string `json:"documentation_url"`
}

func (GithubErrorResponse) Error

func (e GithubErrorResponse) Error() string

type IssuesInfo

type IssuesInfo struct {
	Id          int     `json:"id,omitempty"`
	Url         string  `json:"url,omitempty"`
	HtmlUrl     string  `json:"html_url,omitempty"`
	Number      int     `json:"number,omitempty"`
	State       string  `json:"state,omitempty"`
	Title       string  `json:"title,omitempty"`
	Body        string  `json:"body,omitempty"`
	User        User    `json:"user,omitempty"`
	Labels      []Label `json:"labels,omitempty"`
	Assignee    User    `json:"assignee,omitempty"`
	Assigness   []User  `json:"assigness,omitempty"`
	CreatedAt   string  `json:"created_at,omitempty"`
	UpdatedAt   string  `json:"updated_at,omitempty"`
	ClosedAt    string  `json:"closed_at,omitempty"`
	StateReason string  `json:"state_reason,omitempty"`
}

type Label

type Label struct {
	Color       string `json:"color"`
	Description string `json:"description"`
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Url         string `json:"url"`
}

type OrganizationInfo

type OrganizationInfo struct {
	AvatarUrl   string `json:"avatar_url"`
	Company     string `json:"company"`
	Description string `json:"description"`
	HtmlUrl     string `json:"html_url"`
	Id          int    `json:"id"`
	Login       string `json:"login"`
	Name        string `json:"name"`
	ReposUrl    string `json:"repos_url"`
	Url         string `json:"url"`
}

type OrganizationRepoInfo

type OrganizationRepoInfo struct {
	Description string `json:"description,omitempty"`
	FullName    string `json:"full_name,omitempty"`
	GitUrl      string `json:"git_url,omitempty"`
	HtmlUrl     string `json:"html_url,omitempty"`
	Id          int    `json:"id,omitempty"`
	IssuesUrl   string `json:"issues_url,omitempty"`
	Name        string `json:"name,omitempty"`
	PullsUrl    string `json:"pulls_url,omitempty"`
	Url         string `json:"url,omitempty"`
}

type Pull

type Pull struct {
	Assignee           User    `json:"assignee"`
	Assignees          []User  `json:"assignees"`
	AuthorAssociation  string  `json:"author_association"`
	Body               string  `json:"body"`
	ClosedAt           string  `json:"closed_at"`
	CreatedAt          string  `json:"created_at"`
	HtmlUrl            string  `json:"html_url"`
	Id                 int     `json:"id"`
	IsDraft            bool    `json:"draft"`
	Labels             []Label `json:"labels"`
	MergedAt           string  `json:"merged_at"`
	RequestedReviewers []User  `json:"requested_reviewers"`
	State              string  `json:"state"`
	Title              string  `json:"title"`
	UpdatedAt          string  `json:"updated_at"`
	Url                string  `json:"url"`
	User               User    `json:"user"`
}

type User

type User struct {
	AvatarUrl  string `json:"avatar_url"`
	GravatarId string `json:"gravatar_id"`
	HtmlUrl    string `json:"html_url"`
	Login      string `json:"login"`
	Url        string `json:"url"`
}

Jump to

Keyboard shortcuts

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