source

package
v1.0.0-alpha.15 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const HashicorpSource = "hashicorp"
View Source
const HomebrewSource = "homebrew"
View Source
const (
	VersionLatest = "latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GHCRAuth added in v1.0.1

type GHCRAuth struct {
	Token string `json:"token"`
}

func (*GHCRAuth) Bearer added in v1.0.1

func (g *GHCRAuth) Bearer() string

type GitHub

type GitHub struct {
	Source

	Version string // Version to find for installation
	Owner   string // Owner of the repository
	Repo    string // Repository name

	Release *github.RepositoryRelease

	Assets []*GitHubAsset
	// contains filtered or unexported fields
}

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() (*GitHubAsset, 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) GetDownloadsDir added in v1.0.1

func (s *GitHub) GetDownloadsDir() 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, _, _ string) error

type GitHubAsset added in v1.0.1

type GitHubAsset struct {
	*asset.Asset

	GitHub       *GitHub
	ReleaseAsset *github.ReleaseAsset
}

func (*GitHubAsset) Download added in v1.0.1

func (a *GitHubAsset) Download(ctx context.Context) error

func (*GitHubAsset) ID added in v1.0.1

func (a *GitHubAsset) ID() string

type GitLab

type GitLab struct {
	Source

	Owner   string
	Repo    string
	Version string

	Release *gitlab.Release

	Assets []*GitLabAsset
	// contains filtered or unexported fields
}

func (*GitLab) GetApp

func (s *GitLab) GetApp() string

func (*GitLab) GetDownloadsDir added in v1.0.1

func (s *GitLab) GetDownloadsDir() string

func (*GitLab) GetID

func (s *GitLab) GetID() string

func (*GitLab) GetOwner

func (s *GitLab) GetOwner() string

func (*GitLab) GetRepo

func (s *GitLab) GetRepo() string

func (*GitLab) GetSource

func (s *GitLab) GetSource() string

func (*GitLab) Run

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

type GitLabAsset added in v1.0.1

type GitLabAsset struct {
	*asset.Asset

	GitLab *GitLab
	Link   *gitlab.Links
}

func (*GitLabAsset) Download added in v1.0.1

func (a *GitLabAsset) Download(ctx context.Context) error

func (*GitLabAsset) ID added in v1.0.1

func (a *GitLabAsset) ID() string

type Hashicorp

type Hashicorp struct {
	Source

	Owner   string
	Repo    string
	Version string

	Assets []*HashicorpAsset
	// contains filtered or unexported fields
}

func (*Hashicorp) GetApp

func (s *Hashicorp) GetApp() string

func (*Hashicorp) GetDownloadsDir added in v1.0.1

func (s *Hashicorp) GetDownloadsDir() 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(ctx context.Context, _, _ string) error

type HashicorpAsset added in v1.0.1

type HashicorpAsset struct {
	*asset.Asset

	Hashicorp *Hashicorp
	Build     *hashicorp.Build
	Release   *hashicorp.Release
}

func (*HashicorpAsset) Download added in v1.0.1

func (a *HashicorpAsset) Download(ctx context.Context) error

func (*HashicorpAsset) ID added in v1.0.1

func (a *HashicorpAsset) ID() string

type Homebrew

type Homebrew struct {
	Source

	Formula string
	Version string

	Assets []*HomebrewAsset
	// contains filtered or unexported fields
}

func (*Homebrew) GetApp

func (s *Homebrew) GetApp() string

func (*Homebrew) GetDownloadsDir added in v1.0.1

func (s *Homebrew) GetDownloadsDir() 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(ctx context.Context, _, _ string) error

type HomebrewAsset added in v1.0.1

type HomebrewAsset struct {
	*asset.Asset

	Homebrew    *Homebrew
	FileVariant *homebrew.FileVariant
}

func (*HomebrewAsset) Download added in v1.0.1

func (a *HomebrewAsset) Download(ctx context.Context) error

func (*HomebrewAsset) ID added in v1.0.1

func (a *HomebrewAsset) ID() string

type ISource

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

func New

func New(source string, opts *Options) (ISource, error)

type Options

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

	Settings map[string]interface{}
}

type Source

type Source struct {
	Options  *Options
	OSConfig *osconfig.OS

	File string

	Binary    asset.IAsset
	Signature asset.IAsset
	Checksum  asset.IAsset
	Key       asset.IAsset
}

func (*Source) Cleanup

func (s *Source) Cleanup() error

func (*Source) Download

func (s *Source) Download(ctx context.Context) error

func (*Source) Extract

func (s *Source) Extract() error

func (*Source) GetArch

func (s *Source) GetArch() string

func (*Source) GetOS

func (s *Source) GetOS() string

func (*Source) Install

func (s *Source) Install() error

func (*Source) Verify

func (s *Source) Verify() error

Jump to

Keyboard shortcuts

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