github

package
v0.0.0-...-326c0ea Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACKOrg = "aws-controllers-k8s"
)

Variables

View Source
var ErrForkNotFound = errors.New("fork not found")

Functions

This section is empty.

Types

type Client

type Client struct {
	*github.Client
}

Client is a github.Client wrapper

func NewClient

func NewClient(token string) *Client

NewClient takes a token and instantiate a new Client object

func (*Client) ForkRepository

func (c *Client) ForkRepository(ctx context.Context, repoName string) error

ForkRepository forks a Github repository from the ACK organisation.

func (*Client) GetRepository

func (c *Client) GetRepository(ctx context.Context, owner, repoName string) (*github.Repository, error)

GetRepository takes an owner and repoName and returns the Github repository informations

func (*Client) GetUserRepositoryFork

func (c *Client) GetUserRepositoryFork(ctx context.Context, owner string, repoName string) (*github.Repository, error)

GetUserRepositoryFork takes an ACK repository name and tries to find it fork in the user public repositories.

func (*Client) ListRepositoryForks

func (c *Client) ListRepositoryForks(ctx context.Context, repoName string) ([]*github.Repository, error)

ListRepositoryForks list the forks of a given repository in the ACK organisation. It returns a list fork information which includes the owner and the fork name (forkInfo).

func (*Client) RenameRepository

func (c *Client) RenameRepository(ctx context.Context, owner, name, newName string) error

RenameRepository renames a Github repository. The request should have admin access on the target repositories to be able to rename it.

type RepositoryService

type RepositoryService interface {
	ForkRepository(ctx context.Context, repoName string) error
	RenameRepository(ctx context.Context, owner, name, newName string) error
	GetRepository(ctx context.Context, owner, repoName string) (*github.Repository, error)
	ListRepositoryForks(ctx context.Context, repoName string) ([]*github.Repository, error)
	GetUserRepositoryFork(ctx context.Context, owner, repoName string) (*github.Repository, error)
}

RepositoryService is the interface implemented by the Github client wrapper. It exposes functionalities to simplify the interactions with the repository endpoint of Github APIv3

Jump to

Keyboard shortcuts

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