source

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Untar

func Untar(dst string, r io.Reader) ([]string, error)

Types

type GitHub

type GitHub struct {
	Source

	Owner   string
	Repo    string
	Version string

	GoReleaser *GoReleaser

	Release      *github.RepositoryRelease
	Assets       []*github.ReleaseAsset
	MatchedAsset *github.ReleaseAsset
	// contains filtered or unexported fields
}

func (*GitHub) DetectGoReleaser

func (s *GitHub) DetectGoReleaser()

func (*GitHub) Download

func (s *GitHub) Download(ctx context.Context, version, githubToken string) error

func (*GitHub) FindRelease

func (s *GitHub) FindRelease(ctx context.Context) error

FindRelease - query API to find the version being sought or return an error

func (*GitHub) FindReleaseAsset

func (s *GitHub) FindReleaseAsset() error

FindReleaseAsset - find the asset that matches the current OS and Arch, if multiple matches are found it will attempt to find the best match based on the suffix for the appropriate OS. If no match is found an error is returned.

func (*GitHub) GetApp

func (s *GitHub) GetApp() string

func (*GitHub) GetID

func (s *GitHub) GetID() string

func (*GitHub) GetOwner

func (s *GitHub) GetOwner() string

func (*GitHub) GetReleaseAssets

func (s *GitHub) GetReleaseAssets(ctx context.Context) error

func (*GitHub) GetRepo

func (s *GitHub) GetRepo() string

func (*GitHub) GetSource

func (s *GitHub) GetSource() string

func (*GitHub) Run

func (s *GitHub) Run(ctx context.Context, version, githubToken string) error

type GitLab

type GitLab struct {
	Source

	Owner   string
	Repo    string
	Version string
}

func (*GitLab) GetApp

func (g *GitLab) GetApp() string

func (*GitLab) GetID

func (g *GitLab) GetID() string

func (*GitLab) GetOwner

func (g *GitLab) GetOwner() string

func (*GitLab) GetRepo

func (g *GitLab) GetRepo() string

func (*GitLab) GetSource

func (g *GitLab) GetSource() string

func (*GitLab) Run

func (g *GitLab) Run(_ context.Context, _, _ string) error

type GoReleaser

type GoReleaser struct {
	DataFile      string
	SignatureFile string
	KeyFile       string
	ChecksumFile  string
}

func (*GoReleaser) Verify

func (g *GoReleaser) Verify(ctx context.Context) error

type Hashicorp

type Hashicorp struct {
	Source

	Owner   string
	Repo    string
	Version string
}

func (*Hashicorp) GetApp

func (s *Hashicorp) GetApp() string

func (*Hashicorp) GetID

func (s *Hashicorp) GetID() string

func (*Hashicorp) GetOwner

func (s *Hashicorp) GetOwner() string

func (*Hashicorp) GetRepo

func (s *Hashicorp) GetRepo() string

func (*Hashicorp) GetSource

func (s *Hashicorp) GetSource() string

func (*Hashicorp) Run

func (s *Hashicorp) Run(_ context.Context, _, _ string) error

type Homebrew

type Homebrew struct {
	Source

	Formula string
	Version string
}

func (*Homebrew) GetApp

func (s *Homebrew) GetApp() string

func (*Homebrew) GetID

func (s *Homebrew) GetID() string

func (*Homebrew) GetOwner

func (s *Homebrew) GetOwner() string

func (*Homebrew) GetRepo

func (s *Homebrew) GetRepo() string

func (*Homebrew) GetSource

func (s *Homebrew) GetSource() string

func (*Homebrew) Run

func (s *Homebrew) Run(_ context.Context, _, _ string) error

type ISource

type ISource interface {
	GetSource() string
	GetOwner() string
	GetRepo() string
	GetApp() string
	GetID() string
	Run(context.Context, string, string) error
}

func New

func New(source string, opts *Options) ISource

type Options

type Options struct {
	OS           string
	Arch         string
	HomeDir      string
	CacheDir     string
	BinDir       string
	MetadataDir  string
	DownloadsDir string
}

type Source

type Source struct {
	Options *Options

	File string
}

func (*Source) CopyFile

func (s *Source) CopyFile(srcFile, dstFile string) error

func (*Source) ExtractInstall

func (s *Source) ExtractInstall(repo, binOs, binArch, version string) error

func (*Source) GetArch

func (s *Source) GetArch() string

func (*Source) GetOS

func (s *Source) GetOS() string

Jump to

Keyboard shortcuts

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