github

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetRepository(ctx context.Context, owner, repo string) (*Repository, error)
	UpdateRepository(ctx context.Context, owner, repo string, input *Repository) error
}

func NewClient

func NewClient(token string, httpClient *pkghttp.Client, opts ...Option) (Client, error)

type FakeClient added in v0.3.0

type FakeClient struct {
	Repos map[string]*Repository // key: repo name, value: repo options
	// contains filtered or unexported fields
}

FakeClient implements Client and returns fake objects.

func NewFakeClient added in v0.3.0

func NewFakeClient() *FakeClient

func (*FakeClient) GetRepository added in v0.3.0

func (c *FakeClient) GetRepository(ctx context.Context, owner, repo string) (*Repository, error)

func (*FakeClient) UpdateRepository added in v0.3.0

func (c *FakeClient) UpdateRepository(ctx context.Context, owner, repo string, repository *Repository) error

type Option

type Option func(*client)

func WithLogger

func WithLogger(l *zap.Logger) Option

type Repository added in v0.3.0

type Repository struct {
	Name                string `json:"name"`
	Description         string `json:"description"`
	Homepage            string `json:"homepage"`
	Private             bool   `json:"private"`
	Visibility          string `json:"visibility"`
	HasIssues           bool   `json:"has_issues"`
	HasProjects         bool   `json:"has_projects"`
	HasWiki             bool   `json:"has_wiki"`
	DefaultBranch       string `json:"default_branch"`
	AllowMergeCommit    bool   `json:"allow_merge_commit"`
	AllowRebaseMerge    bool   `json:"allow_rebase_merge"`
	AllowSquashMerge    bool   `json:"allow_squash_merge"`
	DeleteBranchOnMerge bool   `json:"delete_branch_on_merge"`
	Archived            bool   `json:"archived"`
}

Repository represents a GitHub repository.

Jump to

Keyboard shortcuts

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