install

package
v0.0.0-...-dfd24c6 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIRelease

type CLIRelease struct {
	// contains filtered or unexported fields
}

func NewCLIRelease

func NewCLIRelease(httpClient func() *http.Client) *CLIRelease

func (*CLIRelease) GetLatestRelease

func (r *CLIRelease) GetLatestRelease(ctx context.Context) (*Release, error)

type Discovery

type Discovery struct{}

func (*Discovery) ChecksumInfo

func (d *Discovery) ChecksumInfo(r *Release) (string, error)

ChecksumInfo returns OS specific checksum information for Vulnmap CLI.

func (*Discovery) ChecksumURL

func (d *Discovery) ChecksumURL(r *Release) (string, error)

ChecksumURL returns OS specific checksum url for Vulnmap CLI.

func (*Discovery) DownloadURL

func (d *Discovery) DownloadURL(r *Release) (string, error)

DownloadURL returns OS specific download url for Vulnmap CLI.

func (*Discovery) ExecutableName

func (d *Discovery) ExecutableName(isUpdate bool) string

ExecutableName returns OS specific filename for Vulnmap CLI.

func (*Discovery) LookConfigPath

func (d *Discovery) LookConfigPath() (string, error)

func (*Discovery) LookPath

func (d *Discovery) LookPath() (string, error)

LookPath searches for the Vulnmap CLI executable in the directories named by the PATH environment variable.

func (*Discovery) LookUserDir

func (d *Discovery) LookUserDir() (string, error)

LookUserDir searches for the Vulnmap CLI executable in the XDG_DATA_HOME/vulnmap-ls directory.

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(errorReporter error_reporting.ErrorReporter, httpClientFunc func() *http.Client) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(r *Release, isUpdate bool) error

type FakeInstaller

type FakeInstaller struct {
	// contains filtered or unexported fields
}

func NewFakeInstaller

func NewFakeInstaller() *FakeInstaller

func (*FakeInstaller) Find

func (t *FakeInstaller) Find() (string, error)

func (*FakeInstaller) Install

func (t *FakeInstaller) Install(_ context.Context) (string, error)

func (*FakeInstaller) Installs

func (t *FakeInstaller) Installs() int

func (*FakeInstaller) Update

func (t *FakeInstaller) Update(_ context.Context) (bool, error)

func (*FakeInstaller) Updates

func (t *FakeInstaller) Updates() int

type HashSum

type HashSum []byte

func HashSumFromHexDigest

func HashSumFromHexDigest(hexDigest string) (HashSum, error)

func (HashSum) String

func (hs HashSum) String() string

type Install

type Install struct {
	// contains filtered or unexported fields
}

func NewInstaller

func NewInstaller(errorReporter error_reporting.ErrorReporter, client func() *http.Client) *Install

func (*Install) Find

func (i *Install) Find() (string, error)

func (*Install) Install

func (i *Install) Install(ctx context.Context) (string, error)

func (*Install) Update

func (i *Install) Update(ctx context.Context) (bool, error)

type Installer

type Installer interface {
	Find() (string, error)
	Install(ctx context.Context) (string, error)
	Update(ctx context.Context) (bool, error)
}

type Release

type Release struct {
	Version string         `json:"version,omitempty"`
	Assets  *ReleaseAssets `json:"assets,omitempty"`
}

Release represents a Vulnmap CLI release with assets.

type ReleaseAsset

type ReleaseAsset struct {
	URL          string `json:"url,omitempty"`
	ChecksumInfo string `json:"sha256,omitempty"`
	ChecksumURL  string `json:"sha256Url,omitempty"`
}

ReleaseAsset represents a Vulnmap CLI release asset including url to CLI binary and sha256 checksum.

type ReleaseAssets

type ReleaseAssets struct {
	AlpineLinux *ReleaseAsset `json:"vulnmap-alpine,omitempty"`
	Linux       *ReleaseAsset `json:"vulnmap-linux,omitempty"`
	LinuxARM64  *ReleaseAsset `json:"vulnmap-linux-arm64,omitempty"`
	MacOS       *ReleaseAsset `json:"vulnmap-macos,omitempty"`
	MacOSARM64  *ReleaseAsset `json:"vulnmap-macos-arm64,omitempty"`
	Windows     *ReleaseAsset `json:"vulnmap-win.exe,omitempty"`
}

ReleaseAssets represents a assets object.

Jump to

Keyboard shortcuts

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