github

package
v0.0.0-...-dc77c34 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetLogin() (*User, error)
	ListUsers() Users
	GetUser(string) (*User, error)
	ListMembers(string) Members
	GetRepo(string) (*Repo, error)
	UpdateRepo(string, *UpdateRepoParams) (*Repo, error)
	ListLabels(string) Labels
	CreateLabel(string, *CreateLabelParams) (*Label, error)
	UpdateLabel(string, string, *UpdateLabelParams) (*Label, error)
	ListIssues(string, *ListIssuesParams) Issues
	GetIssue(string, int) (*Issue, error)
	AddAssignees(string, int, []string) error
	ListComments(string, int) Comments
	ListEvents(string, int) Events
	ListPullReqs(string, *ListPullReqsParams) PullReqs
	GetPullReq(string, int) (*PullReq, error)
	ListPullReqCommits(string, int) Commits
	GetDiff(string, string) (string, error)
	GetCompare(string, string, string) (string, error)
	ListReviews(string, int) Reviews
	GetReview(string, int, int) (*Review, error)
	ListReviewComments(string, int) ReviewComments
	ListProjects(string, *ListProjectsParams) Projects
	GetProject(int) (*Project, error)
	CreateProject(string, *CreateProjectParams) (*Project, error)
	UpdateProject(int, *UpdateProjectParams) (*Project, error)
	DeleteProject(int) error
	ListProjectColumns(int) ProjectColumns
	GetProjectColumn(int) (*ProjectColumn, error)
	CreateProjectColumn(int, string) (*ProjectColumn, error)
	UpdateProjectColumn(int, string) (*ProjectColumn, error)
	ListProjectCards(int) ProjectCards
	GetProjectCard(int) (*ProjectCard, error)
	CreateProjectCard(int, *CreateProjectCardParams) (*ProjectCard, error)
	UpdateProjectCard(int, *UpdateProjectCardParams) (*ProjectCard, error)
	MoveProjectCard(int, *MoveProjectCardParams) (*ProjectCard, error)
	ListMilestones(string, *ListMilestonesParams) Milestones
	GetMilestone(string, int) (*Milestone, error)
	CreateMilestone(string, *CreateMilestoneParams) (*Milestone, error)
	UpdateMilestone(string, int, *UpdateMilestoneParams) (*Milestone, error)
	DeleteMilestone(string, int) error
	ListHooks(string) Hooks
	GetHook(string, int) (*Hook, error)
	CreateHook(string, *CreateHookParams) (*Hook, error)
	UpdateHook(string, int, *UpdateHookParams) (*Hook, error)
	Import(string, *Import) (*ImportResult, error)
	GetImport(string, int) (*ImportResult, error)
}

Client represents a GitHub client.

func New

func New(token, endpoint, proxy string, opts ...ClientOption) Client

New creates a new GitHub client.

type ClientOption

type ClientOption func(*client)

ClientOption is an option of client.

func ClientLogger

func ClientLogger(l *Logger) ClientOption

ClientLogger returns a client option to set the logger.

type Comment

type Comment struct {
	Body      string `json:"body"`
	HTMLURL   string `json:"html_url"`
	User      *User  `json:"user"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

Comment represents a comment.

func CommentsToSlice

func CommentsToSlice(cs Comments) ([]*Comment, error)

CommentsToSlice collects Comments.

type Comments

type Comments <-chan interface{}

Comments represents a collection of comments.

func CommentsFromSlice

func CommentsFromSlice(xs []*Comment) Comments

CommentsFromSlice creates Comments from a slice.

func (Comments) Next

func (cs Comments) Next() (*Comment, error)

Next emits the next Comment.

type Commit

type Commit struct {
	SHA     string `json:"sha"`
	HTMLURL string `json:"html_url"`
	Commit  struct {
		Author    *CommitUser `json:"author"`
		Committer *CommitUser `json:"committer"`
		Message   string      `json:"message"`
	} `json:"commit"`
	Author    *User `json:"author"`
	Committer *User `json:"committer"`
	Parents   []struct {
		URL string `json:"url"`
		SHA string `json:"sha"`
	} `json:"parents"`
}

Commit represents a commit.

func CommitsToSlice

func CommitsToSlice(cs Commits) ([]*Commit, error)

CommitsToSlice collects Commits.

type CommitUser

type CommitUser struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Date  string `json:"date"`
}

CommitUser represents a commit user.

type Commits

type Commits <-chan interface{}

Commits represents a collection of commits.

func CommitsFromSlice

func CommitsFromSlice(xs []*Commit) Commits

CommitsFromSlice creates Commits from a slice.

func (Commits) Next

func (cs Commits) Next() (*Commit, error)

Next emits the next Commit.

type CreateHookParams

type CreateHookParams struct {
	Name   string      `json:"name"`
	Active bool        `json:"active"`
	Events []string    `json:"events"`
	Config *HookConfig `json:"config"`
}

CreateHookParams represents the parameter for CreateHook API.

type CreateLabelParams

type CreateLabelParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Color       string `json:"color"`
}

CreateLabelParams represents the parameter for CreateLabel API.

type CreateMilestoneParams

type CreateMilestoneParams struct {
	Title       string         `json:"title"`
	Description string         `json:"description"`
	State       MilestoneState `json:"state"`
	DueOn       string         `json:"due_on,omitempty"`
}

CreateMilestoneParams represents the parameter for CreateMilestone API.

type CreateProjectCardParams

type CreateProjectCardParams struct {
	Note        string                 `json:"note,omitempty"`
	ContentID   int                    `json:"content_id,omitempty"`
	ContentType ProjectCardContentType `json:"content_type,omitempty"`
}

CreateProjectCardParams represents the parameter for CreateProjectCard API.

type CreateProjectParams

type CreateProjectParams struct {
	Name string `json:"name"`
	Body string `json:"body"`
}

CreateProjectParams represents the parameter for CreateProject API.

type Event

type Event struct {
	ID              int                   `json:"id"`
	Actor           *User                 `json:"actor"`
	Event           string                `json:"event"`
	Label           *EventLabel           `json:"label"`
	CommitID        string                `json:"commit_id"`
	Rename          *EventRename          `json:"rename"`
	LockReason      string                `json:"lock_reason"`
	Assignee        *User                 `json:"assignee"`
	Assignees       []*User               `json:"assignees"`
	Assigner        *User                 `json:"assigner"`
	Reviewer        *User                 `json:"requested_reviewer"`
	Reviewers       []*User               `json:"requested_reviewers"`
	RequestedTeam   *EventTeam            `json:"requested_team"`
	DismissedReview *EventDismissedReview `json:"dismissed_review"`
	ProjectCard     *EventProjectCard     `json:"project_card"`
	Milestone       *EventMilestone       `json:"milestone"`
	CreatedAt       string                `json:"created_at"`
}

Event represents an event.

func EventsToSlice

func EventsToSlice(es Events) ([]*Event, error)

EventsToSlice collects Events.

type EventDismissedReview

type EventDismissedReview struct {
	State            string `json:"state"`
	ReviewID         int    `json:"review_id"`
	DismissalMessage string `json:"dismissal_message"`
}

EventDismissedReview ...

type EventLabel

type EventLabel struct {
	Name  string `json:"name"`
	Color string `json:"color"`
}

EventLabel ...

type EventMilestone

type EventMilestone struct {
	Title string `json:"title"`
}

EventMilestone ...

type EventProjectCard

type EventProjectCard struct {
	ID                 int    `json:"id"`
	ProjectID          int    `json:"project_id"`
	ColumnName         string `json:"column_name"`
	PreviousColumnName string `json:"previous_column_name"`
}

EventProjectCard ...

type EventRename

type EventRename struct {
	From string `json:"from"`
	To   string `json:"to"`
}

EventRename ...

type EventTeam

type EventTeam struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

EventTeam ...

type Events

type Events <-chan interface{}

Events represents a collection of events.

func EventsFromSlice

func EventsFromSlice(xs []*Event) Events

EventsFromSlice creates Events from a slice.

func (Events) Next

func (es Events) Next() (*Event, error)

Next emits the next Event.

type Hook

type Hook struct {
	Type      string      `json:"type"`
	ID        int         `json:"id"`
	Name      string      `json:"name"`
	Active    bool        `json:"active"`
	Events    []string    `json:"events"`
	Config    *HookConfig `json:"config"`
	CreatedAt string      `json:"created_at"`
	UpdatedAt string      `json:"updated_at"`
}

Hook represents a hook.

func HooksToSlice

func HooksToSlice(hs Hooks) ([]*Hook, error)

HooksToSlice collects Hooks.

type HookConfig

type HookConfig struct {
	ContentType string `json:"content_type"`
	URL         string `json:"url"`
	InsecureSsl string `json:"insecure_ssl"`
	Secret      string `json:"secret,omitempty"`
}

HookConfig ...

type Hooks

type Hooks <-chan interface{}

Hooks represents a collection of hooks.

func HooksFromSlice

func HooksFromSlice(xs []*Hook) Hooks

HooksFromSlice creates Hooks from a slice.

func (Hooks) Next

func (hs Hooks) Next() (*Hook, error)

Next emits the next Hook.

type Import

type Import struct {
	Issue    *ImportIssue     `json:"issue"`
	Comments []*ImportComment `json:"comments"`
}

Import represents an importing object.

type ImportComment

type ImportComment struct {
	Body      string `json:"body"`
	CreatedAt string `json:"created_at"`
}

ImportComment represents an importing comment.

type ImportIssue

type ImportIssue struct {
	Title     string   `json:"title"`
	Body      string   `json:"body"`
	CreatedAt string   `json:"created_at"`
	UpdatedAt string   `json:"updated_at"`
	Closed    bool     `json:"closed"`
	ClosedAt  string   `json:"closed_at,omitempty"`
	Labels    []string `json:"labels,omitempty"`
	Assignee  string   `json:"assignee,omitempty"`
	Milestone int      `json:"milestone,omitempty"`
}

ImportIssue represents an importing issue.

type ImportResult

type ImportResult struct {
	ID              int       `json:"id"`
	Status          string    `json:"status"`
	URL             string    `json:"url"`
	ImportIssuesURL string    `json:"import_issues_url"`
	RepositoryURL   string    `json:"repository_url"`
	CreatedAt       string    `json:"created_at"`
	UpdatedAt       string    `json:"updated_at"`
	Errors          apiErrors `json:"errors"`
}

ImportResult represents the result of import.

type Issue

type Issue struct {
	ID          int               `json:"id"`
	Number      int               `json:"number"`
	Title       string            `json:"title"`
	State       IssueState        `json:"state"`
	Body        string            `json:"body"`
	HTMLURL     string            `json:"html_url"`
	User        *User             `json:"user"`
	Assignee    *User             `json:"assignee"`
	Assignees   []*User           `json:"assignees"`
	CreatedAt   string            `json:"created_at"`
	UpdatedAt   string            `json:"updated_at"`
	ClosedAt    string            `json:"closed_at,omitempty"`
	ClosedBy    *User             `json:"closed_by,omitempty"`
	Labels      []*Label          `json:"labels"`
	PullRequest *IssuePullRequest `json:"pull_request"`
	Milestone   *Milestone        `json:"milestone"`
}

Issue represents an issue.

func IssuesToSlice

func IssuesToSlice(is Issues) ([]*Issue, error)

IssuesToSlice collects Issues.

func (*Issue) Type

func (i *Issue) Type() IssueType

Type returns IssueTypePullReq ("pull request") or IssueTypeIssue ("issue").

type IssuePullRequest

type IssuePullRequest struct {
	URL      string `json:"url"`
	HTMLURL  string `json:"html_url"`
	DiffURL  string `json:"diff_url"`
	PatchURL string `json:"patch_url"`
}

IssuePullRequest represents the pull request information of an issue.

type IssueState

type IssueState int

IssueState ...

const (
	IssueStateOpen IssueState = iota + 1
	IssueStateClosed
)

IssueState ...

func (IssueState) GoString

func (t IssueState) GoString() string

GoString implements GoString

func (IssueState) MarshalJSON

func (t IssueState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (IssueState) String

func (t IssueState) String() string

String implements Stringer

func (*IssueState) UnmarshalJSON

func (t *IssueState) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type IssueType

type IssueType int

IssueType ...

const (
	IssueTypeIssue IssueType = iota + 1
	IssueTypePullReq
)

IssueType ...

func (IssueType) String

func (t IssueType) String() string

type Issues

type Issues <-chan interface{}

Issues represents a collection of issues.

func IssuesFromSlice

func IssuesFromSlice(xs []*Issue) Issues

IssuesFromSlice creates Issues from a slice.

func (Issues) Next

func (is Issues) Next() (*Issue, error)

Next emits the next Issue.

type Label

type Label struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Color       string `json:"color"`
	Default     bool   `json:"default"`
}

Label represents a label.

func LabelsToSlice

func LabelsToSlice(ls Labels) ([]*Label, error)

LabelsToSlice collects Labels.

type Labels

type Labels <-chan interface{}

Labels represents a collection of labels.

func LabelsFromSlice

func LabelsFromSlice(xs []*Label) Labels

LabelsFromSlice creates Labels from a slice.

func (Labels) Next

func (ls Labels) Next() (*Label, error)

Next emits the next Label.

type ListIssuesParamDirection

type ListIssuesParamDirection int

ListIssuesParamDirection ...

const (
	ListIssuesParamDirectionDefault ListIssuesParamDirection = iota + 1
	ListIssuesParamDirectionAsc
	ListIssuesParamDirectionDesc
)

ListIssuesParamDirection ...

func (ListIssuesParamDirection) String

func (f ListIssuesParamDirection) String() string

type ListIssuesParamFilter

type ListIssuesParamFilter int

ListIssuesParamFilter ...

const (
	ListIssuesParamFilterDefault ListIssuesParamFilter = iota + 1
	ListIssuesParamFilterAssigned
	ListIssuesParamFilterCreated
	ListIssuesParamFilterMentioned
	ListIssuesParamFilterSubscribed
	ListIssuesParamFilterAll
)

ListIssuesParamFilter ...

func (ListIssuesParamFilter) String

func (f ListIssuesParamFilter) String() string

type ListIssuesParamSort

type ListIssuesParamSort int

ListIssuesParamSort ...

const (
	ListIssuesParamSortDefault ListIssuesParamSort = iota + 1
	ListIssuesParamSortCreated
	ListIssuesParamSortUpdated
	ListIssuesParamSortComments
)

ListIssuesParamSort ...

func (ListIssuesParamSort) String

func (f ListIssuesParamSort) String() string

type ListIssuesParamState

type ListIssuesParamState int

ListIssuesParamState ...

const (
	ListIssuesParamStateDefault ListIssuesParamState = iota + 1
	ListIssuesParamStateOpen
	ListIssuesParamStateClosed
	ListIssuesParamStateAll
)

ListIssuesParamState ...

func (ListIssuesParamState) String

func (f ListIssuesParamState) String() string

type ListIssuesParams

type ListIssuesParams struct {
	Filter    ListIssuesParamFilter
	State     ListIssuesParamState
	Sort      ListIssuesParamSort
	Direction ListIssuesParamDirection
}

ListIssuesParams represents the parameter for ListIssues API.

type ListMilestonesParamDirection

type ListMilestonesParamDirection int

ListMilestonesParamDirection ...

const (
	ListMilestonesParamDirectionDefault ListMilestonesParamDirection = iota + 1
	ListMilestonesParamDirectionAsc
	ListMilestonesParamDirectionDesc
)

ListMilestonesParamDirection ...

func (ListMilestonesParamDirection) String

type ListMilestonesParamSort

type ListMilestonesParamSort int

ListMilestonesParamSort ...

const (
	ListMilestonesParamSortDefault ListMilestonesParamSort = iota + 1
	ListMilestonesParamSortDueOn
	ListMilestonesParamSortCompleteness
)

ListMilestonesParamSort ...

func (ListMilestonesParamSort) String

func (f ListMilestonesParamSort) String() string

type ListMilestonesParamState

type ListMilestonesParamState int

ListMilestonesParamState ...

const (
	ListMilestonesParamStateDefault ListMilestonesParamState = iota + 1
	ListMilestonesParamStateOpen
	ListMilestonesParamStateClosed
	ListMilestonesParamStateAll
)

ListMilestonesParamState ...

func (ListMilestonesParamState) String

func (f ListMilestonesParamState) String() string

type ListMilestonesParams

type ListMilestonesParams struct {
	State     ListMilestonesParamState
	Direction ListMilestonesParamDirection
	Sort      ListMilestonesParamSort
}

ListMilestonesParams represents the parameter for ListMilestones API.

type ListProjectsParamState

type ListProjectsParamState int

ListProjectsParamState ...

const (
	ListProjectsParamStateDefault ListProjectsParamState = iota + 1
	ListProjectsParamStateOpen
	ListProjectsParamStateClosed
	ListProjectsParamStateAll
)

ListProjectsParamState ...

func (ListProjectsParamState) String

func (f ListProjectsParamState) String() string

type ListProjectsParams

type ListProjectsParams struct {
	State ListProjectsParamState
}

ListProjectsParams represents the parameter for ListProjects API.

type ListPullReqsParamDirection

type ListPullReqsParamDirection int

ListPullReqsParamDirection ...

const (
	ListPullReqsParamDirectionDefault ListPullReqsParamDirection = iota + 1
	ListPullReqsParamDirectionAsc
	ListPullReqsParamDirectionDesc
)

ListPullReqsParamDirection ...

func (ListPullReqsParamDirection) String

type ListPullReqsParamSort

type ListPullReqsParamSort int

ListPullReqsParamSort ...

const (
	ListPullReqsParamSortDefault ListPullReqsParamSort = iota + 1
	ListPullReqsParamSortCreated
	ListPullReqsParamSortUpdated
	ListPullReqsParamSortPopularity
	ListPullReqsParamSortLongRunning
)

ListPullReqsParamSort ...

func (ListPullReqsParamSort) String

func (f ListPullReqsParamSort) String() string

type ListPullReqsParamState

type ListPullReqsParamState int

ListPullReqsParamState ...

const (
	ListPullReqsParamStateDefault ListPullReqsParamState = iota + 1
	ListPullReqsParamStateOpen
	ListPullReqsParamStateClosed
	ListPullReqsParamStateAll
)

ListPullReqsParamState ...

func (ListPullReqsParamState) String

func (f ListPullReqsParamState) String() string

type ListPullReqsParams

type ListPullReqsParams struct {
	State     ListPullReqsParamState
	Head      string
	Base      string
	Sort      ListPullReqsParamSort
	Direction ListPullReqsParamDirection
}

ListPullReqsParams represents the parameter for ListPullReqs API.

type Logger

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

Logger ...

func NewLogger

func NewLogger(opts ...LoggerOption) *Logger

NewLogger creates a new Logger.

type LoggerOption

type LoggerOption func(*Logger)

LoggerOption is an option of Logger.

func LoggerPostRequest

func LoggerPostRequest(callback func(*http.Response, error)) LoggerOption

LoggerPostRequest ...

func LoggerPreRequest

func LoggerPreRequest(callback func(*http.Request)) LoggerOption

LoggerPreRequest ...

type Member

type Member User

Member represents a member.

func MembersToSlice

func MembersToSlice(ms Members) ([]*Member, error)

MembersToSlice collects Members.

func (*Member) ToUser

func (m *Member) ToUser() *User

ToUser converts *Member to *User.

type Members

type Members <-chan interface{}

Members represents a collection of comments.

func MembersFromSlice

func MembersFromSlice(xs []*Member) Members

MembersFromSlice creates Members from a slice.

func (Members) Next

func (ms Members) Next() (*Member, error)

Next emits the next Member.

type Milestone

type Milestone struct {
	ID               int            `json:"id"`
	HTMLURL          string         `json:"html_url"`
	Number           int            `json:"number"`
	Title            string         `json:"title"`
	Description      string         `json:"description"`
	State            MilestoneState `json:"state"`
	OpenMilestones   int            `json:"open_milestones"`
	ClosedMilestones int            `json:"closed_milestones"`
	Creator          *User          `json:"creator"`
	CreatedAt        string         `json:"created_at"`
	UpdatedAt        string         `json:"updated_at"`
	ClosedAt         string         `json:"closed_at"`
	DueOn            string         `json:"due_on"`
}

Milestone represents a milestone.

func MilestonesToSlice

func MilestonesToSlice(ms Milestones) ([]*Milestone, error)

MilestonesToSlice collects Milestones.

type MilestoneState

type MilestoneState int

MilestoneState ...

const (
	MilestoneStateOpen MilestoneState = iota + 1
	MilestoneStateClosed
)

MilestoneState ...

func (MilestoneState) GoString

func (t MilestoneState) GoString() string

GoString implements GoString

func (MilestoneState) MarshalJSON

func (t MilestoneState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (MilestoneState) String

func (t MilestoneState) String() string

String implements Stringer

func (*MilestoneState) UnmarshalJSON

func (t *MilestoneState) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Milestones

type Milestones <-chan interface{}

Milestones represents a collection of milestones.

func MilestonesFromSlice

func MilestonesFromSlice(xs []*Milestone) Milestones

MilestonesFromSlice creates Milestones from a slice.

func (Milestones) Next

func (ms Milestones) Next() (*Milestone, error)

Next emits the next Milestone.

type MockClient

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

MockClient represents a mock for GitHub client.

func NewMockClient

func NewMockClient(opts ...MockClientOption) *MockClient

NewMockClient creates a new MockClient.

func (*MockClient) AddAssignees

func (c *MockClient) AddAssignees(repo string, issueNumber int, assignees []string) error

AddAssignees ...

func (*MockClient) CreateHook

func (c *MockClient) CreateHook(repo string, params *CreateHookParams) (*Hook, error)

CreateHook ...

func (*MockClient) CreateLabel

func (c *MockClient) CreateLabel(repo string, params *CreateLabelParams) (*Label, error)

CreateLabel ...

func (*MockClient) CreateMilestone

func (c *MockClient) CreateMilestone(repo string, params *CreateMilestoneParams) (*Milestone, error)

CreateMilestone ...

func (*MockClient) CreateProject

func (c *MockClient) CreateProject(repo string, params *CreateProjectParams) (*Project, error)

CreateProject ...

func (*MockClient) CreateProjectCard

func (c *MockClient) CreateProjectCard(columnID int, params *CreateProjectCardParams) (*ProjectCard, error)

CreateProjectCard ...

func (*MockClient) CreateProjectColumn

func (c *MockClient) CreateProjectColumn(projectID int, name string) (*ProjectColumn, error)

CreateProjectColumn ...

func (*MockClient) DeleteMilestone

func (c *MockClient) DeleteMilestone(repo string, milestoneNumber int) error

DeleteMilestone ...

func (*MockClient) DeleteProject

func (c *MockClient) DeleteProject(projectID int) error

DeleteProject ...

func (*MockClient) GetCompare

func (c *MockClient) GetCompare(repo string, base, head string) (string, error)

GetCompare ...

func (*MockClient) GetDiff

func (c *MockClient) GetDiff(repo string, sha string) (string, error)

GetDiff ...

func (*MockClient) GetHook

func (c *MockClient) GetHook(repo string, hookID int) (*Hook, error)

GetHook ...

func (*MockClient) GetImport

func (c *MockClient) GetImport(repo string, id int) (*ImportResult, error)

GetImport ...

func (*MockClient) GetIssue

func (c *MockClient) GetIssue(repo string, issueNumber int) (*Issue, error)

GetIssue ...

func (*MockClient) GetLogin

func (c *MockClient) GetLogin() (*User, error)

GetLogin ...

func (*MockClient) GetMilestone

func (c *MockClient) GetMilestone(repo string, milestoneNumber int) (*Milestone, error)

GetMilestone ...

func (*MockClient) GetProject

func (c *MockClient) GetProject(projectID int) (*Project, error)

GetProject ...

func (*MockClient) GetProjectCard

func (c *MockClient) GetProjectCard(projectCardID int) (*ProjectCard, error)

GetProjectCard ...

func (*MockClient) GetProjectColumn

func (c *MockClient) GetProjectColumn(projectColumnID int) (*ProjectColumn, error)

GetProjectColumn ...

func (*MockClient) GetPullReq

func (c *MockClient) GetPullReq(repo string, pullNumber int) (*PullReq, error)

GetPullReq ...

func (*MockClient) GetRepo

func (c *MockClient) GetRepo(repo string) (*Repo, error)

GetRepo ...

func (*MockClient) GetReview

func (c *MockClient) GetReview(repo string, pullNumber, reviewID int) (*Review, error)

GetReview ...

func (*MockClient) GetUser

func (c *MockClient) GetUser(name string) (*User, error)

GetUser ...

func (*MockClient) Import

func (c *MockClient) Import(repo string, issue *Import) (*ImportResult, error)

Import ...

func (*MockClient) ListComments

func (c *MockClient) ListComments(repo string, issueNumber int) Comments

ListComments ...

func (*MockClient) ListEvents

func (c *MockClient) ListEvents(repo string, issueNumber int) Events

ListEvents ...

func (*MockClient) ListHooks

func (c *MockClient) ListHooks(repo string) Hooks

ListHooks ...

func (*MockClient) ListIssues

func (c *MockClient) ListIssues(repo string, params *ListIssuesParams) Issues

ListIssues ...

func (*MockClient) ListLabels

func (c *MockClient) ListLabels(repo string) Labels

ListLabels ...

func (*MockClient) ListMembers

func (c *MockClient) ListMembers(org string) Members

ListMembers ...

func (*MockClient) ListMilestones

func (c *MockClient) ListMilestones(repo string, params *ListMilestonesParams) Milestones

ListMilestones ...

func (*MockClient) ListProjectCards

func (c *MockClient) ListProjectCards(columnID int) ProjectCards

ListProjectCards ...

func (*MockClient) ListProjectColumns

func (c *MockClient) ListProjectColumns(projectID int) ProjectColumns

ListProjectColumns ...

func (*MockClient) ListProjects

func (c *MockClient) ListProjects(repo string, params *ListProjectsParams) Projects

ListProjects ...

func (*MockClient) ListPullReqCommits

func (c *MockClient) ListPullReqCommits(repo string, pullNumber int) Commits

ListPullReqCommits ...

func (*MockClient) ListPullReqs

func (c *MockClient) ListPullReqs(repo string, params *ListPullReqsParams) PullReqs

ListPullReqs ...

func (*MockClient) ListReviewComments

func (c *MockClient) ListReviewComments(repo string, pullNumber int) ReviewComments

ListReviewComments ...

func (*MockClient) ListReviews

func (c *MockClient) ListReviews(repo string, pullNumber int) Reviews

ListReviews ...

func (*MockClient) ListUsers

func (c *MockClient) ListUsers() Users

ListUsers ...

func (*MockClient) MoveProjectCard

func (c *MockClient) MoveProjectCard(projectCardID int, params *MoveProjectCardParams) (*ProjectCard, error)

MoveProjectCard ...

func (*MockClient) UpdateHook

func (c *MockClient) UpdateHook(repo string, hookID int, params *UpdateHookParams) (*Hook, error)

UpdateHook ...

func (*MockClient) UpdateLabel

func (c *MockClient) UpdateLabel(repo, name string, params *UpdateLabelParams) (*Label, error)

UpdateLabel ...

func (*MockClient) UpdateMilestone

func (c *MockClient) UpdateMilestone(repo string, milestoneNumber int, params *UpdateMilestoneParams) (*Milestone, error)

UpdateMilestone ...

func (*MockClient) UpdateProject

func (c *MockClient) UpdateProject(projectID int, params *UpdateProjectParams) (*Project, error)

UpdateProject ...

func (*MockClient) UpdateProjectCard

func (c *MockClient) UpdateProjectCard(projectCardID int, params *UpdateProjectCardParams) (*ProjectCard, error)

UpdateProjectCard ...

func (*MockClient) UpdateProjectColumn

func (c *MockClient) UpdateProjectColumn(projectColumnID int, name string) (*ProjectColumn, error)

UpdateProjectColumn ...

func (*MockClient) UpdateRepo

func (c *MockClient) UpdateRepo(repo string, params *UpdateRepoParams) (*Repo, error)

UpdateRepo ...

type MockClientOption

type MockClientOption func(*MockClient)

MockClientOption is an option of mock client.

func MockAddAssignees

func MockAddAssignees(callback func(string, int, []string) error) MockClientOption

MockAddAssignees ...

func MockCreateHook

func MockCreateHook(callback func(string, *CreateHookParams) (*Hook, error)) MockClientOption

MockCreateHook ...

func MockCreateLabel

func MockCreateLabel(callback func(string, *CreateLabelParams) (*Label, error)) MockClientOption

MockCreateLabel ...

func MockCreateMilestone

func MockCreateMilestone(callback func(string, *CreateMilestoneParams) (*Milestone, error)) MockClientOption

MockCreateMilestone ...

func MockCreateProject

func MockCreateProject(callback func(string, *CreateProjectParams) (*Project, error)) MockClientOption

MockCreateProject ...

func MockCreateProjectCard

func MockCreateProjectCard(callback func(int, *CreateProjectCardParams) (*ProjectCard, error)) MockClientOption

MockCreateProjectCard ...

func MockCreateProjectColumn

func MockCreateProjectColumn(callback func(int, string) (*ProjectColumn, error)) MockClientOption

MockCreateProjectColumn ...

func MockDeleteMilestone

func MockDeleteMilestone(callback func(string, int) error) MockClientOption

MockDeleteMilestone ...

func MockDeleteProject

func MockDeleteProject(callback func(int) error) MockClientOption

MockDeleteProject ...

func MockGetCompare

func MockGetCompare(callback func(string, string, string) (string, error)) MockClientOption

MockGetCompare ...

func MockGetDiff

func MockGetDiff(callback func(string, string) (string, error)) MockClientOption

MockGetDiff ...

func MockGetHook

func MockGetHook(callback func(string, int) (*Hook, error)) MockClientOption

MockGetHook ...

func MockGetImport

func MockGetImport(callback func(string, int) (*ImportResult, error)) MockClientOption

MockGetImport ...

func MockGetIssue

func MockGetIssue(callback func(string, int) (*Issue, error)) MockClientOption

MockGetIssue ...

func MockGetLogin

func MockGetLogin(callback func() (*User, error)) MockClientOption

MockGetLogin ...

func MockGetMilestone

func MockGetMilestone(callback func(string, int) (*Milestone, error)) MockClientOption

MockGetMilestone ...

func MockGetProject

func MockGetProject(callback func(int) (*Project, error)) MockClientOption

MockGetProject ...

func MockGetProjectCard

func MockGetProjectCard(callback func(int) (*ProjectCard, error)) MockClientOption

MockGetProjectCard ...

func MockGetProjectColumn

func MockGetProjectColumn(callback func(int) (*ProjectColumn, error)) MockClientOption

MockGetProjectColumn ...

func MockGetPullReq

func MockGetPullReq(callback func(string, int) (*PullReq, error)) MockClientOption

MockGetPullReq ...

func MockGetRepo

func MockGetRepo(callback func(string) (*Repo, error)) MockClientOption

MockGetRepo ...

func MockGetReview

func MockGetReview(callback func(string, int, int) (*Review, error)) MockClientOption

MockGetReview ...

func MockGetUser

func MockGetUser(callback func(string) (*User, error)) MockClientOption

MockGetUser ...

func MockImport

func MockImport(callback func(string, *Import) (*ImportResult, error)) MockClientOption

MockImport ...

func MockListComments

func MockListComments(callback func(string, int) Comments) MockClientOption

MockListComments ...

func MockListEvents

func MockListEvents(callback func(string, int) Events) MockClientOption

MockListEvents ...

func MockListHooks

func MockListHooks(callback func(string) Hooks) MockClientOption

MockListHooks ...

func MockListIssues

func MockListIssues(callback func(string, *ListIssuesParams) Issues) MockClientOption

MockListIssues ...

func MockListLabels

func MockListLabels(callback func(string) Labels) MockClientOption

MockListLabels ...

func MockListMembers

func MockListMembers(callback func(string) Members) MockClientOption

MockListMembers ...

func MockListMilestones

func MockListMilestones(callback func(string, *ListMilestonesParams) Milestones) MockClientOption

MockListMilestones ...

func MockListProjectCards

func MockListProjectCards(callback func(int) ProjectCards) MockClientOption

MockListProjectCards ...

func MockListProjectColumns

func MockListProjectColumns(callback func(int) ProjectColumns) MockClientOption

MockListProjectColumns ...

func MockListProjects

func MockListProjects(callback func(string, *ListProjectsParams) Projects) MockClientOption

MockListProjects ...

func MockListPullReqCommits

func MockListPullReqCommits(callback func(string, int) Commits) MockClientOption

MockListPullReqCommits ...

func MockListPullReqs

func MockListPullReqs(callback func(string, *ListPullReqsParams) PullReqs) MockClientOption

MockListPullReqs ...

func MockListReviewComments

func MockListReviewComments(callback func(string, int) ReviewComments) MockClientOption

MockListReviewComments ...

func MockListReviews

func MockListReviews(callback func(string, int) Reviews) MockClientOption

MockListReviews ...

func MockListUsers

func MockListUsers(callback func() Users) MockClientOption

MockListUsers ...

func MockMoveProjectCard

func MockMoveProjectCard(callback func(int, *MoveProjectCardParams) (*ProjectCard, error)) MockClientOption

MockMoveProjectCard ...

func MockUpdateHook

func MockUpdateHook(callback func(string, int, *UpdateHookParams) (*Hook, error)) MockClientOption

MockUpdateHook ...

func MockUpdateLabel

func MockUpdateLabel(callback func(string, string, *UpdateLabelParams) (*Label, error)) MockClientOption

MockUpdateLabel ...

func MockUpdateMilestone

func MockUpdateMilestone(callback func(string, int, *UpdateMilestoneParams) (*Milestone, error)) MockClientOption

MockUpdateMilestone ...

func MockUpdateProject

func MockUpdateProject(callback func(int, *UpdateProjectParams) (*Project, error)) MockClientOption

MockUpdateProject ...

func MockUpdateProjectCard

func MockUpdateProjectCard(callback func(int, *UpdateProjectCardParams) (*ProjectCard, error)) MockClientOption

MockUpdateProjectCard ...

func MockUpdateProjectColumn

func MockUpdateProjectColumn(callback func(int, string) (*ProjectColumn, error)) MockClientOption

MockUpdateProjectColumn ...

func MockUpdateRepo

func MockUpdateRepo(callback func(string, *UpdateRepoParams) (*Repo, error)) MockClientOption

MockUpdateRepo ...

type MoveProjectCardParams

type MoveProjectCardParams struct {
	Position string `json:"position"`
	ColumnID bool   `json:"column_id,omitempty"`
}

MoveProjectCardParams represents the parameter for MoveProjectCard API.

type Project

type Project struct {
	ID         int          `json:"id"`
	Name       string       `json:"name"`
	Body       string       `json:"body"`
	Number     int          `json:"number"`
	State      ProjectState `json:"state"`
	OwnerURL   string       `json:"owner_url"`
	URL        string       `json:"url"`
	HTMLURL    string       `json:"html_url"`
	ColumnsURL string       `json:"columns_url"`
	Creator    *User        `json:"creator"`
	CreatedAt  string       `json:"created_at"`
	UpdatedAt  string       `json:"updated_at"`
}

Project represents a project.

func ProjectsToSlice

func ProjectsToSlice(ps Projects) ([]*Project, error)

ProjectsToSlice collects Projects.

type ProjectCard

type ProjectCard struct {
	ID         int    `json:"id"`
	Note       string `json:"note"`
	Archived   bool   `json:"archived"`
	Creator    *User  `json:"creator"`
	ContentURL string `json:"content_url"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
}

ProjectCard represents a project card.

func ProjectCardsToSlice

func ProjectCardsToSlice(ps ProjectCards) ([]*ProjectCard, error)

ProjectCardsToSlice collects ProjectCards.

func (*ProjectCard) GetIssueNumber

func (c *ProjectCard) GetIssueNumber() int

GetIssueNumber ...

type ProjectCardContentType

type ProjectCardContentType int

ProjectCardContentType ...

const (
	ProjectCardContentTypeIssue ProjectCardContentType = iota + 1
	ProjectCardContentTypePullRequest
)

ProjectCardContentType ...

func (ProjectCardContentType) GoString

func (t ProjectCardContentType) GoString() string

GoString implements GoString

func (ProjectCardContentType) MarshalJSON

func (t ProjectCardContentType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (ProjectCardContentType) String

func (t ProjectCardContentType) String() string

String implements Stringer

func (*ProjectCardContentType) UnmarshalJSON

func (t *ProjectCardContentType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type ProjectCards

type ProjectCards <-chan interface{}

ProjectCards represents a collection of project cards.

func ProjectCardsFromSlice

func ProjectCardsFromSlice(xs []*ProjectCard) ProjectCards

ProjectCardsFromSlice creates ProjectCards from a slice.

func (ProjectCards) Next

func (ps ProjectCards) Next() (*ProjectCard, error)

Next emits the next ProjectCard.

type ProjectColumn

type ProjectColumn struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	URL       string `json:"url"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

ProjectColumn represents a project column.

func ProjectColumnsToSlice

func ProjectColumnsToSlice(ps ProjectColumns) ([]*ProjectColumn, error)

ProjectColumnsToSlice collects ProjectColumns.

type ProjectColumns

type ProjectColumns <-chan interface{}

ProjectColumns represents a collection of project columns.

func ProjectColumnsFromSlice

func ProjectColumnsFromSlice(xs []*ProjectColumn) ProjectColumns

ProjectColumnsFromSlice creates ProjectColumns from a slice.

func (ProjectColumns) Next

func (ps ProjectColumns) Next() (*ProjectColumn, error)

Next emits the next ProjectColumn.

type ProjectState

type ProjectState int

ProjectState ...

const (
	ProjectStateOpen ProjectState = iota + 1
	ProjectStateClosed
)

ProjectState ...

func (ProjectState) GoString

func (t ProjectState) GoString() string

GoString implements GoString

func (ProjectState) MarshalJSON

func (t ProjectState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (ProjectState) String

func (t ProjectState) String() string

String implements Stringer

func (*ProjectState) UnmarshalJSON

func (t *ProjectState) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Projects

type Projects <-chan interface{}

Projects represents a collection of projects.

func ProjectsFromSlice

func ProjectsFromSlice(xs []*Project) Projects

ProjectsFromSlice creates Projects from a slice.

func (Projects) Next

func (ps Projects) Next() (*Project, error)

Next emits the next Project.

type PullReq

type PullReq struct {
	Issue
	Merged         bool        `json:"merged"`
	MergedAt       string      `json:"merged_at"`
	MergedBy       *User       `json:"merged_by"`
	MergeCommitSHA string      `json:"merge_commit_sha"`
	Draft          bool        `json:"draft"`
	Head           *PullReqRef `json:"head"`
	Base           *PullReqRef `json:"base"`
	Commits        int         `json:"commits"`
	Additions      int         `json:"additions"`
	Deletions      int         `json:"deletions"`
	ChangedFiles   int         `json:"changed_files"`
}

PullReq represents a pull request.

func PullReqsToSlice

func PullReqsToSlice(ps PullReqs) ([]*PullReq, error)

PullReqsToSlice collects PullReqs.

type PullReqRef

type PullReqRef struct {
	SHA  string `json:"sha"`
	Ref  string `json:"ref"`
	User *User  `json:"user"`
	Repo *Repo  `json:"repo"`
}

PullReqRef ...

type PullReqs

type PullReqs <-chan interface{}

PullReqs represents a collection of pull requests.

func PullReqsFromSlice

func PullReqsFromSlice(xs []*PullReq) PullReqs

PullReqsFromSlice creates PullReqs from a slice.

func (PullReqs) Next

func (ps PullReqs) Next() (*PullReq, error)

Next emits the next PullReq.

type Repo

type Repo struct {
	Name        string `json:"name"`
	FullName    string `json:"full_name"`
	Description string `json:"description"`
	Homepage    string `json:"homepage"`
	HTMLURL     string `json:"html_url"`
	Private     bool   `json:"private"`
}

Repo represents a repository.

type Review

type Review struct {
	ID          int         `json:"id"`
	State       ReviewState `json:"state"`
	Body        string      `json:"body"`
	HTMLURL     string      `json:"html_url"`
	User        *User       `json:"user"`
	CommitID    string      `json:"commit_id"`
	SubmittedAt string      `json:"submitted_at"`
}

Review represents a review.

func ReviewsToSlice

func ReviewsToSlice(rs Reviews) ([]*Review, error)

ReviewsToSlice collects Reviews.

type ReviewComment

type ReviewComment struct {
	ID          int    `json:"id"`
	Path        string `json:"path"`
	Body        string `json:"body"`
	DiffHunk    string `json:"diff_hunk"`
	HTMLURL     string `json:"html_url"`
	User        *User  `json:"user"`
	InReplyToID int    `json:"in_reply_to_id"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

ReviewComment represents a review comment.

func ReviewCommentsToSlice

func ReviewCommentsToSlice(cs ReviewComments) ([]*ReviewComment, error)

ReviewCommentsToSlice collects ReviewComments.

type ReviewComments

type ReviewComments <-chan interface{}

ReviewComments represents a collection of review comments.

func ReviewCommentsFromSlice

func ReviewCommentsFromSlice(xs []*ReviewComment) ReviewComments

ReviewCommentsFromSlice creates ReviewComments from a slice.

func (ReviewComments) Next

func (cs ReviewComments) Next() (*ReviewComment, error)

Next emits the next ReviewComment.

type ReviewState

type ReviewState int

ReviewState ...

const (
	ReviewStateApproved ReviewState = iota + 1
	ReviewStateChangesRequested
	ReviewStateCommented
	ReviewStatePending
	ReviewStateDismissed
)

ReviewState ...

func (ReviewState) GoString

func (t ReviewState) GoString() string

GoString implements GoString

func (ReviewState) MarshalJSON

func (t ReviewState) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (ReviewState) String

func (t ReviewState) String() string

String implements Stringer

func (*ReviewState) UnmarshalJSON

func (t *ReviewState) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Reviews

type Reviews <-chan interface{}

Reviews represents a collection of reviews.

func ReviewsFromSlice

func ReviewsFromSlice(xs []*Review) Reviews

ReviewsFromSlice creates Reviews from a slice.

func (Reviews) Next

func (rs Reviews) Next() (*Review, error)

Next emits the next Review.

type UpdateHookParams

type UpdateHookParams struct {
	Active bool        `json:"active"`
	Events []string    `json:"events"`
	Config *HookConfig `json:"config"`
}

UpdateHookParams represents the parameter for UpdateHook API.

type UpdateLabelParams

type UpdateLabelParams struct {
	Name        string `json:"new_name"`
	Description string `json:"description"`
	Color       string `json:"color"`
}

UpdateLabelParams represents the parameter for UpdateLabel API.

type UpdateMilestoneParams

type UpdateMilestoneParams CreateMilestoneParams

UpdateMilestoneParams represents the parameter for UpdateMilestone API.

type UpdateProjectCardParams

type UpdateProjectCardParams struct {
	Note     string `json:"note,omitempty"`
	Archived bool   `json:"archived,omitempty"`
}

UpdateProjectCardParams represents the parameter for UpdateProjectCard API.

type UpdateProjectParams

type UpdateProjectParams struct {
	Name  string       `json:"name,omitempty"`
	Body  string       `json:"body,omitempty"`
	State ProjectState `json:"state,omitempty"`
}

UpdateProjectParams represents the parameter for UpdateProject API.

type UpdateRepoParams

type UpdateRepoParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Homepage    string `json:"homepage"`
	Private     bool   `json:"private"`
}

UpdateRepoParams represents a parameter on updating a repository.

type User

type User struct {
	Login   string `json:"login"`
	HTMLURL string `json:"html_url"`
}

User represents a user.

func UsersToSlice

func UsersToSlice(cs Users) ([]*User, error)

UsersToSlice collects Users.

type Users

type Users <-chan interface{}

Users represents a collection of users.

func UsersFromSlice

func UsersFromSlice(xs []*User) Users

UsersFromSlice creates Users from a slice.

func (Users) Next

func (cs Users) Next() (*User, error)

Next emits the next User.

Jump to

Keyboard shortcuts

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