github

package module
v0.0.0-...-0d420a4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

README

TODO

  • Repository linting tool
    • Has README
    • Has CONTRIBUTING
    • Has license
    • Has PR template
    • Has issue template
    • Stale (no push within X days, can we mark as stable somehow?)
    • Has description

Documentation

Index

Constants

View Source
const DefaultURL = "https://api.github.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Debug      bool
	HTTPClient *http.Client
	Token      string
	URL        string
}

func Login

func Login(ctx context.Context, user, pass, id, secret string) (*Client, error)

func MustLogin

func MustLogin(ctx context.Context, user, pass, id, secret string) *Client

func New

func New(token string) *Client

func (*Client) CreatePullRequestFromIssue

func (c *Client) CreatePullRequestFromIssue(ctx context.Context, org, repo, head string, number int) (*PullRequest, error)

type Comment

type Comment struct {
	ID        int64     `json:"id"`
	NodeID    string    `json:"node_id"`
	URL       string    `json:"url"`
	IssueURL  string    `json:"issue_url"`
	HtmlURL   string    `json:"html_url"`
	Body      string    `json:"body"`
	User      User      `json:"user"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CommentsService

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

func NewCommentsService

func NewCommentsService(c *Client) *CommentsService

func (*CommentsService) GetComments

func (s *CommentsService) GetComments(ctx context.Context, params GetCommentsParams) ([]*Comment, error)

func (*CommentsService) GetIssueComments

func (s *CommentsService) GetIssueComments(ctx context.Context, params GetIssueCommentsParams) ([]*Comment, error)

type ErrorResponse

type ErrorResponse struct {
	Message          string `json:"message"`
	DocumentationURL string `json:"documentation_url"`
	Errors           []struct {
		Message string `json:"message"`
	} `json:"errors"`
}

type GetAssigneesParams

type GetAssigneesParams struct {
	Org  string
	Repo string
}

type GetCommentsParams

type GetCommentsParams struct {
	Org  string
	Repo string
}

type GetIssueCommentsParams

type GetIssueCommentsParams struct {
	Org         string
	Repo        string
	IssueNumber int64
}

type GetIssueParams

type GetIssueParams struct {
	Org    string
	Repo   string
	Number string
}

type GetIssuesParams

type GetIssuesParams struct {
	Org  string
	Repo string
}

type GetLabelsParams

type GetLabelsParams struct {
	Org  string
	Repo string
}

type GetReposParams

type GetReposParams struct {
	Org string
}

type Issue

type Issue struct {
	ID               int64      `json:"id"`
	NodeID           string     `json:"node_id"`
	URL              string     `json:"url"`
	RepositoryURL    string     `json:"repository_url"`
	LabelsURL        string     `json:"labels_url"`
	CommentsURL      string     `json:"comments_url"`
	EventsURL        string     `json:"events_url"`
	HtmlURL          string     `json:"html_url"`
	Number           int64      `json:"number"`
	State            string     `json:"state"`
	Title            string     `json:"title"`
	Body             string     `json:"body"`
	User             *User      `json:"user"`
	Labels           []Label    `json:"labels"`
	Assignee         *User      `json:"assignee"`
	Assignees        []User     `json:"assignees"`
	Milestone        *Milestone `json:"milestone"`
	Locked           bool       `json:"locked"`
	ActiveLockReason string     `json:"active_lock_reason"`
	Comments         int64      `json:"comments"`
	PullRequest      *struct {
		URL      string `json:"url"`
		HtmlURL  string `json:"html_url"`
		DiffURL  string `json:"diff_url"`
		PatchURL string `json:"patch_url"`
	} `json:"pull_request"`
	ClosedAt  *string   `json:"closed_at"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	ClosedBy  *User     `json:"closed_by"`
}

func (Issue) HasLabel

func (i Issue) HasLabel(name string) bool

type IssuesService

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

func NewIssuesService

func NewIssuesService(c *Client) *IssuesService

func (*IssuesService) GetIssue

func (s *IssuesService) GetIssue(ctx context.Context, params GetIssueParams) (*Issue, error)

func (*IssuesService) GetIssues

func (s *IssuesService) GetIssues(ctx context.Context, params GetIssuesParams) ([]*Issue, error)

type Label

type Label struct {
	ID          int64  `json:"id"`
	NodeID      string `json:"node_id"`
	URL         string `json:"url"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Color       string `json:"color"`
	Default     bool   `json:"default"`
}

type LabelsService

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

func NewLabelsService

func NewLabelsService(c *Client) *LabelsService

func (*LabelsService) GetLabels

func (s *LabelsService) GetLabels(ctx context.Context, params GetLabelsParams) ([]*Label, error)

type Milestone

type Milestone struct {
	URL          string `json:"url"`
	HtmlURL      string `json:"html_url"`
	LabelsURL    string `json:"labels_url"`
	ID           int64  `json:"id"`
	NodeID       string `json:"node_id"`
	Number       int64  `json:"number"`
	State        string `json:"state"`
	Title        string `json:"title"`
	Description  string `json:"description"`
	Creator      User   `json:"creator"`
	OpenIssues   int64  `json:"open_issues"`
	ClosedIssues int64  `json:"closed_issues"`
	CreatedAt    string `json:"created_at"`
	UpdatedAt    string `json:"updated_at"`
	ClosedAt     string `json:"closed_at"`
	DueOn        string `json:"due_on"`
}

type PullRequest

type PullRequest struct {
	URL string `json:"html_url"`
}

type Repo

type Repo struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	Private     bool      `json:"private"`
	Description string    `json:"description"`
	Fork        bool      `json:"fork"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	PushedAt    time.Time `json:"pushed_at"`
	Archived    bool      `json:"archived"`
	Disabled    bool      `json:"disabled"`
	HtmlURL     string    `json:"html_url"`
}

type ReposService

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

func NewReposService

func NewReposService(c *Client) *ReposService

func (*ReposService) GetRepos

func (s *ReposService) GetRepos(ctx context.Context, params GetReposParams) ([]*Repo, error)

type User

type User struct {
	Login             string `json:"login"`
	ID                int64  `json:"id"`
	NodeID            string `json:"node_id"`
	AvatarURL         string `json:"avatar_url"`
	GravatarID        string `json:"gravatar_id"`
	URL               string `json:"url"`
	HtmlURL           string `json:"html_url"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
	SiteAdmin         bool   `json:"site_admin"`
}

type UsersService

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

func NewUsersService

func NewUsersService(c *Client) *UsersService

func (*UsersService) GetAssignees

func (s *UsersService) GetAssignees(ctx context.Context, params GetAssigneesParams) ([]*User, error)

Jump to

Keyboard shortcuts

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