hub

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGithubToken added in v1.6.0

func GetGithubToken(host, user string) (string, error)

func SetGithubToken added in v1.6.0

func SetGithubToken(host, user, token string) error

Types

type Client

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

func New

func New(authContext context.Context, ev gogh.Env) (*Client, error)

New builds GitHub Client with GitHub API token that is configured.

func (*Client) Create

func (i *Client) Create(
	ctx context.Context,
	ev gogh.Env,
	repo *gogh.Repo,
	description string,
	homepage *url.URL,
	private bool,
) (newRepo *github.Repository, retErr error)

Create new repository.

func (*Client) Fork

func (i *Client) Fork(
	ctx context.Context,
	ev gogh.Env,
	repo *gogh.Repo,
	organization string,
) (result *gogh.Repo, retErr error)

Fork will fork a repository for yours (or for the organization).

func (*Client) Repos

func (i *Client) Repos(ctx context.Context, ev gogh.Env, user string, own, collaborate, member, fork, archived bool, visibility, sort, direction string) ([]string, error)

Repos will get a list of repositories for a user. Parameters:

  • user: Who has the repositories. Empty means the token user
  • own: Include repositories that are owned by the user
  • collaborate: Include repositories that the user has been added to as a collaborator
  • member: Include repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on
  • archived: Include archived repositories.
  • fork: Include forked repositories.
  • visibility: Can be one of all, public, or private
  • sort: Can be one of created, updated, pushed, full_name
  • direction: Can be one of asc or desc default. Default means asc when using full_name, otherwise desc

Returns:

List of the url for repoisitories

Jump to

Keyboard shortcuts

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