mcpinstaller

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: MIT Imports: 11 Imported by: 0

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