client

package
v0.0.0-...-f2c9dc4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignee

type Assignee struct {
	Login string `csv:"Assignee" json:"login,omitempty"`
}

Assignee is a user.

type Client

type Client struct {
	Pulls *HandlerPull
	Repos *HandlerRepo
}

Client is an api client.

func NewClient

func NewClient(token string) *Client

NewClient creates a client.

type GetOrgRepoParams

type GetOrgRepoParams struct {
	PerPage int
	Page    int
}

GetOrgRepoParams is parameters for GetOrgRepos.

type GetPullParams

type GetPullParams struct {
	PerPage int
	State   string
	Page    int
}

GetPullParams is parameters for GetPull.

type HTTPClient

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

HTTPClient is a HTTPClient.

func NewHTTPClient

func NewHTTPClient(httpClient *http.Client) *HTTPClient

NewHTTPClient creates a HTTPClient

func (*HTTPClient) Do

func (hc *HTTPClient) Do(req *http.Request) ([]byte, error)

Do

func (*HTTPClient) NewRequest

func (hc *HTTPClient) NewRequest(method string, header http.Header, body []byte, url string) (*http.Request, error)

NewClient creates a request.

type HandlerPull

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

HandlerPull is a handler for pulls.

func NewHandlerPull

func NewHandlerPull(httpClient *HTTPClient) *HandlerPull

NewHandlerPull creates a handler.

func (*HandlerPull) GetPullsByAssignee

func (hp *HandlerPull) GetPullsByAssignee(assignee string, owner string, repo string, params GetPullParams) ([]*PullRequest, error)

GetPulls gets pulls by assignee.

type HandlerRepo

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

HandlerRepo is a handler for repos.

func NewHandlerRepo

func NewHandlerRepo(httpClient *HTTPClient) *HandlerRepo

NewHandlerRepo creates a handler.

func (*HandlerRepo) GetOrgRepos

func (hr *HandlerRepo) GetOrgRepos(org string, params GetOrgRepoParams) ([]*Repository, error)

GetOrgsRepos get organization repositories.

type PullRequest

type PullRequest struct {
	ID        int64      `json:"id,omitempty"`
	Number    int        `json:"number,omitempty"`
	State     string     `json:"state,omitempty"`
	Title     string     `json:"title,omitempty"`
	Body      string     `json:"body,omitempty"`
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	ClosedAt  *time.Time `json:"closed_at,omitempty"`
	HTMLURL   string     `json:"html_url,omitempty"`
	Assignee  *Assignee  `csv:"-"`
}

PullRequest is a pull request. see: https://github.com/google/go-github/blob/master/github/pulls.go

type Repository

type Repository struct {
	Name string
}

Repository is a repository.

Jump to

Keyboard shortcuts

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