Documentation
¶
Overview ¶
Package install downloads prebuilt libds4 release assets for the ds4go CLI.
Index ¶
- Constants
- func FindDirHolders(dirPath string) (map[int][]string, error)
- func PrintCatalog(out io.Writer, catalog *CatalogResult)
- func Status(ctx context.Context, opts Options) error
- func Uninstall(ctx context.Context, opts Options) error
- func Validate(ctx context.Context, opts Options) error
- type CatalogAsset
- type CatalogResult
- type InstallMetadata
- type LsofProcess
- type Options
- type ProcessInfo
- type Result
Constants ¶
const ( // MetadataFileName is the name of the JSON metadata file written // alongside libds4 to record what is installed. MetadataFileName = "ds4go-install.json" // KindRelease marks metadata for a prebuilt asset downloaded from // GitHub. An empty Kind is treated as release for back-compat with // metadata written before pinning existed. KindRelease = "release" // KindPinned marks metadata for a developer-supplied libds4 copied in // via `install --pin`. KindPinned = "pinned" )
const (
// DefaultRepo is the GitHub repository used for prebuilt libds4 binaries.
DefaultRepo = "NimbleMarkets/ds4"
)
Variables ¶
This section is empty.
Functions ¶
func FindDirHolders ¶ added in v0.4.0
FindDirHolders finds processes holding any files under dirPath. It returns a map of PID to a list of file paths they hold under that directory.
func PrintCatalog ¶ added in v0.5.1
func PrintCatalog(out io.Writer, catalog *CatalogResult)
PrintCatalog writes a human-readable install catalog.
Types ¶
type CatalogAsset ¶ added in v0.5.1
type CatalogAsset struct {
Name string `json:"name"`
URL string `json:"url"`
Digest string `json:"digest,omitempty"`
GOOS string `json:"goos,omitempty"`
GOARCH string `json:"goarch,omitempty"`
Backend string `json:"backend,omitempty"`
Archive string `json:"archive,omitempty"`
Parsed bool `json:"parsed"`
Selected bool `json:"selected"`
}
CatalogAsset describes one installable libds4 release asset.
type CatalogResult ¶ added in v0.5.1
type CatalogResult struct {
Repo string `json:"repo"`
Version string `json:"version"`
Assets []CatalogAsset `json:"assets"`
}
CatalogResult describes the libds4 release assets available for installation.
func Catalog ¶ added in v0.5.1
func Catalog(ctx context.Context, opts Options) (*CatalogResult, error)
Catalog fetches the selected GitHub release and lists available libds4 assets. Empty GOOS, GOARCH, and Backend fields mean no filter. Backend "auto" is also treated as no filter because the catalog is informational.
type InstallMetadata ¶ added in v0.3.0
type InstallMetadata struct {
Kind string `json:"kind,omitempty"`
Repo string `json:"repo,omitempty"`
Version string `json:"version,omitempty"`
AssetName string `json:"asset_name,omitempty"`
AssetURL string `json:"asset_url,omitempty"`
Source string `json:"source,omitempty"`
Backend string `json:"backend"`
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
Digest string `json:"digest,omitempty"`
SHA256 string `json:"sha256"`
InstalledAt time.Time `json:"installed_at"`
}
InstallMetadata holds information about the installed libds4.
Kind discriminates between the supported install sources:
- "release" (or "" for back-compat with metadata written by older ds4go versions): a prebuilt asset downloaded from GitHub. Repo/Version/ AssetName/AssetURL/Digest are populated.
- "pinned": a developer-supplied file copied in via `install --pin`. Source holds the absolute path the file was copied from.
type LsofProcess ¶ added in v0.4.0
LsofProcess represents a process and its open files parsed from lsof.
type Options ¶
type Options struct {
Repo string
Version string
Backend string
GOOS string
GOARCH string
DestDir string
URL string
Pin string // local libds4 file to copy in and mark pinned
Asset string
Token string
Force bool
DryRun bool
SkipChecksum bool
Out io.Writer
ProgressOut io.Writer
HTTPClient *http.Client
In io.Reader
Confirm func(prompt string, defaultYes bool) (bool, error)
}
Options configures a libds4 installation.
type ProcessInfo ¶ added in v0.4.0
ProcessInfo represents a process holding or using a shared library.
func FindLibraryHolders ¶ added in v0.4.0
func FindLibraryHolders(libPath string) ([]ProcessInfo, error)
FindLibraryHolders finds all processes holding onto the library path.