Documentation ¶
Index ¶
- type CLIRelease
- type Discovery
- func (d *Discovery) ChecksumInfo(r *Release) (string, error)
- func (d *Discovery) ChecksumURL(r *Release) (string, error)
- func (d *Discovery) DownloadURL(r *Release) (string, error)
- func (d *Discovery) ExecutableName(isUpdate bool) string
- func (d *Discovery) LookConfigPath() (string, error)
- func (d *Discovery) LookPath() (string, error)
- func (d *Discovery) LookUserDir() (string, error)
- type Downloader
- type FakeInstaller
- type HashSum
- type Install
- type Installer
- type Release
- type ReleaseAsset
- type ReleaseAssets
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 ¶
ChecksumInfo returns OS specific checksum information for Vulnmap CLI.
func (*Discovery) ChecksumURL ¶
ChecksumURL returns OS specific checksum url for Vulnmap CLI.
func (*Discovery) DownloadURL ¶
DownloadURL returns OS specific download url for Vulnmap CLI.
func (*Discovery) ExecutableName ¶
ExecutableName returns OS specific filename for Vulnmap CLI.
func (*Discovery) LookConfigPath ¶
func (*Discovery) LookPath ¶
LookPath searches for the Vulnmap CLI executable in the directories named by the PATH environment variable.
func (*Discovery) LookUserDir ¶
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
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) Installs ¶
func (t *FakeInstaller) Installs() int
func (*FakeInstaller) Updates ¶
func (t *FakeInstaller) Updates() int
type Install ¶
type Install struct {
// contains filtered or unexported fields
}
func NewInstaller ¶
func NewInstaller(errorReporter error_reporting.ErrorReporter, client func() *http.Client) *Install
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.