Documentation
¶
Index ¶
- Variables
- func CheckBrewInstall(goos platformutil.Platform) (string, error)
- func GetAssetFromRelease(tag, assetName, repoName string, g GHRepoService) (*github.ReleaseAsset, error)
- func GetCommitSHA1(repoName, version string, g GHRepoService) (string, error)
- func GetFullyQualifiedImageName(prefix, version, image string, pre bool, g GHRepoService) (string, string, error)
- func GetLatestRelease(repoName string, g GHRepoService) (*github.RepositoryRelease, error)
- func GetReleaseByTag(repoName, tag string, g GHRepoService) (*github.RepositoryRelease, error)
- func GetSandboxImageSha(tag string, pre bool, g GHRepoService) (string, string, error)
- func GetUpgradeMessage(latest string, goos platformutil.Platform) (string, error)
- func ListReleases(repoName string, g GHRepoService, filterPrefix string) ([]*github.RepositoryRelease, error)
- type GHProvider
- func (c *GHProvider) Close() error
- func (c *GHProvider) GetCleanLatestVersion() (string, error)
- func (c *GHProvider) GetLatestVersion() (string, error)
- func (c *GHProvider) Open() (err error)
- func (c *GHProvider) Retrieve(src string, dest string) error
- func (c *GHProvider) Walk(walkFn provider.WalkFunc) error
- type GHRepoService
Constants ¶
This section is empty.
Variables ¶
var FlytectlReleaseConfig = &updater.Updater{ Provider: &GHProvider{ RepositoryURL: flytectlRepository, ArchiveName: getFlytectlAssetName(), ghRepo: GetGHRepoService(), }, ExecutableName: flytectl, Version: stdlibversion.Version, }
FlytectlReleaseConfig represent the updater config for flytectl binary
Functions ¶
func CheckBrewInstall ¶
func CheckBrewInstall(goos platformutil.Platform) (string, error)
CheckBrewInstall returns the path of symlink if flytectl is installed from brew
func GetAssetFromRelease ¶
func GetAssetFromRelease(tag, assetName, repoName string, g GHRepoService) (*github.ReleaseAsset, error)
GetAssetFromRelease returns the asset using assetName from github release with tag
func GetCommitSHA1 ¶
func GetCommitSHA1(repoName, version string, g GHRepoService) (string, error)
GetCommitSHA1 returns sha hash against the version
func GetLatestRelease ¶
func GetLatestRelease(repoName string, g GHRepoService) (*github.RepositoryRelease, error)
GetLatestRelease returns the latest non-prerelease version of provided repoName, as described in https://docs.github.com/en/rest/reference/releases#get-the-latest-release
func GetReleaseByTag ¶
func GetReleaseByTag(repoName, tag string, g GHRepoService) (*github.RepositoryRelease, error)
GetReleaseByTag returns the provided tag release if tag exist in repository
func GetSandboxImageSha ¶
GetSandboxImageSha returns the sha as per input
func GetUpgradeMessage ¶
func GetUpgradeMessage(latest string, goos platformutil.Platform) (string, error)
GetUpgradeMessage return the upgrade message
func ListReleases ¶
func ListReleases(repoName string, g GHRepoService, filterPrefix string) ([]*github.RepositoryRelease, error)
ListReleases returns the list of release of provided repoName
Types ¶
type GHProvider ¶ added in v0.9.0
type GHProvider struct { RepositoryURL string // Repository URL, example github.com/mouuff/go-rocket-update ArchiveName string // Archive name (the zip/tar.gz you upload for a release on github), example: binaries.zip // contains filtered or unexported fields }
Github provider finds a archive file in the repository's releases to provide files
func (*GHProvider) Close ¶ added in v0.9.0
func (c *GHProvider) Close() error
Close closes the provider
func (*GHProvider) GetCleanLatestVersion ¶ added in v0.9.0
func (c *GHProvider) GetCleanLatestVersion() (string, error)
GetCleanLatestVersion gets the latest version without the "flytectl/" prefix
func (*GHProvider) GetLatestVersion ¶ added in v0.9.0
func (c *GHProvider) GetLatestVersion() (string, error)
GetLatestVersion gets the latest version
func (*GHProvider) Open ¶ added in v0.9.0
func (c *GHProvider) Open() (err error)
Open opens the provider
type GHRepoService ¶
type GHRepoService interface { GetLatestRelease(ctx context.Context, owner, repo string) (*github.RepositoryRelease, *github.Response, error) ListReleases(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *github.Response, error) }
var Client GHRepoService
func GetGHRepoService ¶
func GetGHRepoService() GHRepoService
GetGHRepoService returns the initialized github repo service client.