githubclient

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithubClient

func NewGithubClient(ctx context.Context, token string) (*githubClient, error)

Types

type GithubClient

type GithubClient interface {
	// GetLatestRelease fetches the latest release for a repo
	GetLatestRelease(ctx context.Context, owner string, repo string) (*client.Release, error)

	// GetCommitSHA1 fetches the commit SHA in a repo based on a tag, branch head, or other ref.
	// NOTE: Github release 2022-11-28 and similar server returns a commitish for a release.
	// The release commitish can be a commit, branch name, or a tag.
	// We need to resolve it to a commit.
	GetCommitSHA1(ctx context.Context, owner string, repo string, ref string) (string, error)

	// GetReleaseByTagSlices fetches metadata regarding releases for a given tag. If the tag is the empty string,
	// it should just return the latest.
	GetReleaseByTag(ctx context.Context, owner string, repo string, tag string) (*client.Release, error)

	// GetReleaseAsset fetches the content of a release asset, e.g. artifacts, metadata documents, etc.
	GetReleaseAsset(asset client.ReleaseAsset) (*client.ReleaseAssetContent, error)
}

TODO (mlieberman85): This interface will probably be pulled out into an interface that can support other services with artifact releases like Gitlab Wrapper interface for Github

Jump to

Keyboard shortcuts

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