github

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 8 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) (*github.Repository, error)
	UpdateRepository(ctx context.Context, owner, repo string, input *UpdateRepositoryInput) error
}

func NewClient

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

type Option

type Option func(*client)

func WithDryRun

func WithDryRun(v bool) Option

func WithLogger

func WithLogger(l *zap.Logger) Option

type UpdateRepositoryInput added in v0.2.0

type UpdateRepositoryInput 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"`
	// IsTemplate         bool
	DefaultBranch       string `json:"default_branch"`
	AllowSquashMerge    bool   `json:"allow_squash_merge"`
	AllowMergeCommit    bool   `json:"allow_merge_commit"`
	AllowRebaseMerge    bool   `json:"allow_rebase_merge"`
	DeleteBranchOnMerge bool   `json:"delete_branch_on_merge"`
	Archived            bool   `json:"archived"`
}

UpdateRepositoryInput is a request for updating a repository. https://developer.github.com/v3/repos/#update-a-repository The fields intentionally commented out are dangerous for bulk update.

Jump to

Keyboard shortcuts

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