updateutils

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Organization        = "projectdiscovery"
	UpdateCheckEndpoint = "https://api.pdtm.sh/api/v1/tools/%v"
)

Variables

View Source
var (
	// By default when tool is updated release notes of latest version are printed
	HideReleaseNotes      = false
	HideProgressBar       = false
	VersionCheckTimeout   = time.Duration(5) * time.Second
	DownloadUpdateTimeout = time.Duration(30) * time.Second
	// Note: DefaultHttpClient is only used in GetToolVersionCallback
	DefaultHttpClient *http.Client
)

Aurora instance

Functions

func GetMachineID

func GetMachineID() string

GetMachineID return a unique identifier that is unique to the machine it is a sha256 hashed value with pdtm as salt

func GetOSVendor

func GetOSVendor() string

Get OS Vendor returns the linux distribution vendor if not linux then returns runtime.GOOS

func GetVersionDescription

func GetVersionDescription(current string, latest string) string

GetVersionDescription returns tags like (latest) or (outdated) or (dev)

func GetpdtmParams

func GetpdtmParams(version string) string

GetpdtmParams returns encoded query parameters sent to update check endpoint

func IsDevReleaseOutdated

func IsDevReleaseOutdated(current string, latest string) bool

IsDevReleaseOutdated returns true if installed tool (dev version) is outdated ex: if installed tools is v2.9.1-dev and latest release is v2.9.1 then it is outdated since v2.9.1-dev is released and merged into main/master branch

func IsOutdated

func IsOutdated(current, latest string) bool

IsOutdated returns true if current version is outdated

Types

type AssetFormat

type AssetFormat uint
const (
	Zip AssetFormat = iota
	Tar
	Unknown
)

func IdentifyAssetFormat

func IdentifyAssetFormat(assetName string) AssetFormat

func (AssetFormat) FileExtension

func (a AssetFormat) FileExtension() string

FileExtension of this asset format

type Tool

type Tool struct {
	Name    string            `json:"name"`
	Repo    string            `json:"repo"`
	Version string            `json:"version"`
	Assets  map[string]string `json:"assets"`
}

Tool

Jump to

Keyboard shortcuts

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