scm

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForRetry added in v1.9.0

func CheckForRetry(resp *github.Response, err error) error

Types

type GithubAdapter

type GithubAdapter struct {
	Client  *github.Client
	Retrier *retry.Retrier
}

func NewGithubAdapter

func NewGithubAdapter(ctx context.Context, pat string, urlDefault string, urlUpload string) (*GithubAdapter, error)

func (*GithubAdapter) GetChangelogForBranches added in v1.27.0

func (c *GithubAdapter) GetChangelogForBranches(ctx context.Context, owner string, repo string, fromBranch string, toBranch string) (*[]ScmCommit, error)

func (*GithubAdapter) GetChangelogForRefs added in v1.26.0

func (c *GithubAdapter) GetChangelogForRefs(ctx context.Context, owner string, repo string, refFrom *ScmRef, refTo *ScmRef) (*[]ScmCommit, error)

func (*GithubAdapter) GetChangelogForTags added in v1.26.0

func (c *GithubAdapter) GetChangelogForTags(ctx context.Context, owner string, repo string, fromTag string, toTag string) (*[]ScmCommit, error)

func (*GithubAdapter) GetCommitFromTag added in v1.36.0

func (c *GithubAdapter) GetCommitFromTag(ctx context.Context, owner string, repo string, gitObj *github.GitObject) (*string, error)

func (*GithubAdapter) GetRepoBranch

func (c *GithubAdapter) GetRepoBranch(ctx context.Context, owner string, repo string, branchName string) (*ScmRef, error)

func (*GithubAdapter) GetRepoCommitsForSha added in v1.26.0

func (c *GithubAdapter) GetRepoCommitsForSha(ctx context.Context, owner string, repo string, toTag string) ([]*github.RepositoryCommit, error)

func (*GithubAdapter) GetRepoCompareCommits added in v1.22.0

func (c *GithubAdapter) GetRepoCompareCommits(ctx context.Context, owner string, repo string, fromSha string, toSha string) (*[]ScmCommit, error)

func (*GithubAdapter) GetRepoFile

func (c *GithubAdapter) GetRepoFile(ctx context.Context, owner string, repo string, sha string, filePath string) ([]byte, error)

func (*GithubAdapter) GetRepoTag added in v1.21.0

func (c *GithubAdapter) GetRepoTag(ctx context.Context, owner string, repo string, tagName string) (*ScmRef, error)

func (*GithubAdapter) GetUserRepos

func (c *GithubAdapter) GetUserRepos(ctx context.Context, user string) ([]ScmRepository, error)

type ScmAdapter

type ScmAdapter interface {
	GetChangelogForBranches(ctx context.Context, owner string, repo string, fromBranch string, toBranch string) (*[]ScmCommit, error)
	GetChangelogForTags(ctx context.Context, owner string, repo string, fromTag string, toTag string) (*[]ScmCommit, error)
	GetRepoBranch(ctx context.Context, owner string, repo string, branchName string) (*ScmRef, error)
	GetRepoFile(ctx context.Context, owner string, repo string, sha string, filePath string) ([]byte, error)
	GetUserRepos(ctx context.Context, user string) ([]ScmRepository, error)
}

type ScmCommit

type ScmCommit struct {
	AuthorAvatarUrl string
	Message         string
	HtmlUrl         string
}

type ScmRef added in v1.20.0

type ScmRef struct {
	CurrentHash string
	Name        string
}

type ScmRepository

type ScmRepository struct {
	DefaultBranch string
	HtmlUrl       string
	Name          string
	OwnerName     string
}

Jump to

Keyboard shortcuts

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