git_repo

package
v0.0.0-...-7c3836c Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchResponse

type BranchResponse struct {
	Name      string  `json:"name,omitempty"`
	Commit    *Commit `json:"commit,omitempty"`
	Protected *bool   `json:"protected,omitempty"`
}

type Commit

type Commit struct {
	SHA       *string       `json:"sha,omitempty"`
	Author    *CommitAuthor `json:"author,omitempty"`
	Committer *CommitAuthor `json:"committer,omitempty"`
	Message   *string       `json:"message,omitempty"`
	//Tree         *Tree                  `json:"tree,omitempty"`
	Parents []Commit     `json:"parents,omitempty"`
	Stats   *CommitStats `json:"stats,omitempty"`
	HTMLURL *string      `json:"html_url,omitempty"`
	URL     *string      `json:"url,omitempty"`
	//Verification *SignatureVerification `json:"verification,omitempty"`
	NodeID *string `json:"node_id,omitempty"`

	// CommentCount is the number of GitHub comments on the commit. This
	// is only populated for requests that fetch GitHub data like
	// Pulls.ListCommits, Repositories.ListCommits, etc.
	CommentCount *int `json:"comment_count,omitempty"`

	// SigningKey denotes a key to sign the commit with. If not nil this key will
	// be used to sign the commit. The private key must be present and already
	// decrypted. Ignored if Verification.Signature is defined.
	SigningKey *openpgp.Entity `json:"-"`
}

type CommitAuthor

type CommitAuthor struct {
	Date  *time.Time `json:"date,omitempty"`
	Name  *string    `json:"name,omitempty"`
	Email *string    `json:"email,omitempty"`

	// The following fields are only populated by Webhook events.
	Login *string `json:"username,omitempty"` // Renamed for go-github consistency.
}

type CommitStats

type CommitStats struct {
	Additions *int `json:"additions,omitempty"`
	Deletions *int `json:"deletions,omitempty"`
	Total     *int `json:"total,omitempty"`
}

type GithubRepository

type GithubRepository interface {
}

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty"`
}

type Repo

type Repo interface {
	ListTags(ctx context.Context, owner, repo string, opts *ListOptions) (res []*TagResponse, err error)
	ListBranch(ctx context.Context, owner, repo string, opts *ListOptions) (res []*BranchResponse, err error)
	GetFile(ctx context.Context, owner, repo, branch, fileName string) (string, error)
}

func NewClient

func NewClient(cf *config.Config) Repo

func NewGithub

func NewGithub(client *github.Client) Repo

func NewGitlab

func NewGitlab(client *gitlab.Client) Repo

type TagResponse

type TagResponse struct {
	Name   string  `json:"name"`
	Commit *Commit `json:"commit"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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