client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package client implements the access to the github API package via interface and own wrapper client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Repositories RepoService
	Issues       IssuesService
	PullRequests PullRequestsService
}

Client wraps the github.Client with interfaces we are using

func New

func New(ctx context.Context, AccessToken string) *Client

New intialized and returns a new gitHubClient Uses AccessToken for oauth2 authentication if not empty

type IssuesService

type IssuesService interface {
	ListByRepo(
		ctx context.Context,
		owner string, repo string,
		opt *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)
}

IssuesService describes the methods we use from github.IssuesService

type PullRequestsService

type PullRequestsService interface {
	List(
		ctx context.Context, owner string, repo string,
		opt *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
}

PullRequestsService describes the methods we use from github.PullRequestsService

type RepoService

type RepoService interface {
	ListTags(
		ctx context.Context,
		owner, repo string,
		opt *github.ListOptions) ([]*github.RepositoryTag, *github.Response, error)
	GetCommit(
		ctx context.Context,
		owner, repo, sha string) (*github.RepositoryCommit, *github.Response, error)
	GetReleaseByTag(
		ctx context.Context,
		owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error)
	Get(
		ctx context.Context,
		owner, repo string) (*github.Repository, *github.Response, error)
}

RepoService describes the methods we use from github.RepositoriesService

Jump to

Keyboard shortcuts

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