mcpinstaller

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 11 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

func CheckIfExecutable

func CheckIfExecutable(filepath string) bool

CheckIfExecutable checks if a file exists and is executable

func DownloadFile

func DownloadFile(url string, filepath string, size int64) error

DownloadFile downloads a file from the given URL with a progress bar

func GetDefaultInstallPath

func GetDefaultInstallPath() (string, error)

GetDefaultInstallPath returns the default installation path for the current OS

func GetExpectedChecksum

func GetExpectedChecksum(checksumsAsset *Asset, binaryName string) (string, error)

GetExpectedChecksum fetches and parses the checksums.txt to get the expected checksum

func MakeExecutable

func MakeExecutable(filepath string) error

MakeExecutable makes a file executable on Unix-like systems

func VerifyChecksum

func VerifyChecksum(filepath string, expectedChecksum string) (bool, error)

VerifyChecksum verifies the SHA256 checksum of a file

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	Size               int64  `json:"size"`
}

Asset represents a release asset

func GetBinaryAsset

func GetBinaryAsset(release *Release, platform Platform) (*Asset, error)

GetBinaryAsset finds the appropriate binary asset for the current platform

func GetChecksumsAsset

func GetChecksumsAsset(release *Release) (*Asset, error)

GetChecksumsAsset finds the checksums.txt asset

type InstallOptions

type InstallOptions struct {
	Version     string // Specific version to install (e.g., "v0.1.3"), empty for latest
	InstallPath string // Where to install the binary
	Force       bool   // Force reinstall even if already exists
}

InstallOptions holds installation options

type Platform

type Platform struct {
	OS   string
	Arch string
}

Platform represents the current platform information

func GetCurrentPlatform

func GetCurrentPlatform() Platform

GetCurrentPlatform returns the current platform information

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Name    string  `json:"name"`
	Assets  []Asset `json:"assets"`
}

Release represents a GitHub release

func GetLatestRelease

func GetLatestRelease() (*Release, error)

GetLatestRelease fetches the latest release information from GitHub

Jump to

Keyboard shortcuts

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