Documentation
¶
Index ¶
- type AptCheckPackageData
- type AptCheckPackageParams
- type AptCheckSpeedData
- type AptCheckStatusData
- type AptDebianMirrorService
- type AptMirrorService
- func (m *AptMirrorService) CacheDirectory() string
- func (m *AptMirrorService) CheckPackage(mirrorURL, packageName string, verbose bool, params AptCheckPackageParams) (bool, *AptCheckPackageData, error)
- func (m *AptMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool) (float64, *AptCheckSpeedData, error)
- func (m *AptMirrorService) CheckStatus(mirrorURL string, verbose bool) (bool, *AptCheckStatusData, error)
- type AptUbuntuMirrorService
- type CargoCheckPackageData
- type CargoCheckSpeedData
- type CargoCheckStatusData
- type CargoMirrorService
- func (m *CargoMirrorService) CheckPackage(mirrorURL, crateName string, verbose bool) (bool, *CargoCheckPackageData, error)
- func (m *CargoMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool, packageName *string) (float64, *CargoCheckSpeedData, error)
- func (m *CargoMirrorService) CheckStatus(url string, verbose bool) (bool, *CargoCheckStatusData, error)
- type ComposerAuthor
- type ComposerCheckPackageData
- type ComposerCheckSpeedData
- type ComposerCheckSpeedParams
- type ComposerCheckStatusData
- type ComposerDownloads
- type ComposerMirrorService
- func (m *ComposerMirrorService) CheckPackage(mirrorURL string, packageName string, verbose bool) (bool, *ComposerCheckPackageData, error)
- func (m *ComposerMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool, params ComposerCheckSpeedParams) (float64, *ComposerCheckSpeedData, error)
- func (m *ComposerMirrorService) CheckStatus(url string, verbose bool) (bool, *ComposerCheckStatusData, error)
- type ConfigDescriptor
- type DigestManifest
- type DockerCheckSpeedData
- type DockerCheckStatusData
- type DockerImageData
- type DockerMirrorService
- func (m *DockerMirrorService) CheckPackage(mirrorUrl, imageName string) (bool, *DockerImageData, error)
- func (m *DockerMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool, imgName *string) (float64, *DockerCheckSpeedData, error)
- func (m *DockerMirrorService) CheckStatus(url string) (bool, *DockerCheckStatusData, error)
- type DockerSpeedParams
- type GoCheckPackageData
- type GoCheckSpeedData
- type GoCheckSpeedParams
- type GoCheckStatusData
- type GoMirrorService
- func (m *GoMirrorService) CheckPackage(mirrorURL string, packageName string, verbose bool) (bool, *GoCheckPackageData, error)
- func (m *GoMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool, params GoCheckSpeedParams) (float64, *GoCheckSpeedData, error)
- func (m *GoMirrorService) CheckStatus(url string, verbose bool) (bool, *GoCheckStatusData, error)
- type GoModuleInfo
- type HttpRequestError
- type InvalidMirrorError
- type JsonParseError
- type LayerDescriptor
- type Manifest
- type ManifestList
- type MiravaService
- type MirrorType
- type NpmCheckPackageData
- type NpmCheckSpeedData
- type NpmCheckSpeedParams
- type NpmCheckStatusData
- type NpmMirrorService
- func (m *NpmMirrorService) CheckPackage(mirrorUrl, packageName string, verbose bool) (bool, *NpmCheckPackageData, error)
- func (m *NpmMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool, packageName *string) (float64, *NpmCheckSpeedData, error)
- func (m *NpmMirrorService) CheckStatus(url string, verbose bool) (bool, *NpmCheckStatusData, error)
- type PackageNotFoundError
- type PackageVersion
- type PacmanCheckPackageData
- type PacmanCheckSpeedData
- type PacmanCheckSpeedParams
- type PacmanCheckStatusData
- type PacmanMirrorService
- func (m *PacmanMirrorService) CheckPackage(mirrorURL, packageName string, verbose bool) (bool, *PacmanCheckPackageData, error)
- func (m *PacmanMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool) (float64, *PacmanCheckSpeedData, error)
- func (m *PacmanMirrorService) CheckStatus(url string, verbose bool) (bool, *PacmanCheckStatusData, error)
- type Platform
- type PyPIMirrorService
- func (m *PyPIMirrorService) CheckPackage(mirrorUrl, packageName string, verbose bool) (bool, *PyPiCheckPackageData, error)
- func (m *PyPIMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool) (float64, *PyPiCheckSpeedData, error)
- func (m *PyPIMirrorService) CheckStatus(url string, verbose bool) (bool, *PyPIStatusResponse, error)
- type PyPIStatusResponse
- type PyPiCheckPackageData
- type PyPiCheckSpeedData
- type PyPiCheckStatusData
- type RegistryInfo
- type ResponseReadError
- type SpeedTestError
- type TimeoutError
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AptCheckPackageData ¶
type AptCheckPackageData struct {
Exists bool `json:"exists"`
PackageName string `json:"package_name"`
Version string `json:"version,omitempty"`
Release string `json:"release,omitempty"`
Component string `json:"component,omitempty"`
Arch string `json:"arch,omitempty"`
CheckedPaths []string `json:"checked_paths"`
FoundPath string `json:"found_path,omitempty"`
}
type AptCheckPackageParams ¶
type AptCheckPackageParams struct {
Release string `validate:"omitempty,oneof=stable oldstable testing focal jammy noble bionic buster bullseye bookworm trixie"`
Component string `validate:"omitempty,oneof=main universe contrib non-free non-free-firmware restricted multiverse"`
Arch string `validate:"omitempty,oneof=amd64 arm64 i386 armhf ppc64el s390x"`
}
type AptCheckSpeedData ¶
type AptCheckSpeedData struct {
SpeedMBps float64 `json:"speed_mbps"`
DownloadedMB float64 `json:"downloaded_mb"`
DurationSec float64 `json:"duration_sec"`
TestURL string `json:"test_url"`
BytesDownloaded int64 `json:"bytes_downloaded"`
TargetBytes int64 `json:"target_bytes"`
ContentLength int64 `json:"content_length"`
TimeoutSec int `json:"timeout_sec"`
SpeedRating string `json:"speed_rating"`
Message string `json:"message"`
}
type AptCheckStatusData ¶
type AptDebianMirrorService ¶
type AptDebianMirrorService = AptMirrorService
type AptMirrorService ¶
type AptMirrorService struct {
HttpClient *http.Client
// CacheTTL controls apt package/index caching (memory + disk). Zero uses apt default.
CacheTTL time.Duration
// CacheDir overrides the on-disk cache location. Empty uses the OS app cache dir
// (os.UserCacheDir()/mirava-core/apt, e.g. ~/Library/Caches/mirava-core/apt on macOS).
CacheDir string
// DisableDiskCache turns off persistent cache (tests only).
DisableDiskCache bool
// Distro specifies the distribution family (Debian, Ubuntu, or generic).
Distro apt.Distro
// contains filtered or unexported fields
}
func NewAptDebianMirrorService ¶
func NewAptDebianMirrorService() *AptMirrorService
func NewAptMirrorService ¶
func NewAptMirrorService() *AptMirrorService
func NewAptUbuntuMirrorService ¶
func NewAptUbuntuMirrorService() *AptMirrorService
func (*AptMirrorService) CacheDirectory ¶
func (m *AptMirrorService) CacheDirectory() string
func (*AptMirrorService) CheckPackage ¶
func (m *AptMirrorService) CheckPackage(mirrorURL, packageName string, verbose bool, params AptCheckPackageParams) (bool, *AptCheckPackageData, error)
func (*AptMirrorService) CheckSpeed ¶
func (m *AptMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool) (float64, *AptCheckSpeedData, error)
func (*AptMirrorService) CheckStatus ¶
func (m *AptMirrorService) CheckStatus(mirrorURL string, verbose bool) (bool, *AptCheckStatusData, error)
type AptUbuntuMirrorService ¶
type AptUbuntuMirrorService = AptMirrorService
type CargoCheckPackageData ¶
type CargoCheckSpeedData ¶
type CargoCheckStatusData ¶
type CargoMirrorService ¶
func NewCargoMirrorService ¶
func NewCargoMirrorService() *CargoMirrorService
NewCargoMirrorService creates a new Cargo sparse index mirror service instance.
func (*CargoMirrorService) CheckPackage ¶
func (m *CargoMirrorService) CheckPackage( mirrorURL, crateName string, verbose bool, ) (bool, *CargoCheckPackageData, error)
CheckPackage checks if a crate exists on a Cargo sparse HTTP index mirror.
func (*CargoMirrorService) CheckSpeed ¶
func (m *CargoMirrorService) CheckSpeed( mirrorURL string, timeout int, verbose bool, packageName *string, ) (float64, *CargoCheckSpeedData, error)
func (*CargoMirrorService) CheckStatus ¶
func (m *CargoMirrorService) CheckStatus( url string, verbose bool, ) (bool, *CargoCheckStatusData, error)
type ComposerAuthor ¶
type ComposerCheckSpeedData ¶
type ComposerCheckStatusData ¶
type ComposerDownloads ¶
type ComposerMirrorService ¶
func NewComposerMirrorService ¶
func NewComposerMirrorService() *ComposerMirrorService
NewComposerMirrorService creates a new Composer mirror service instance
func (*ComposerMirrorService) CheckPackage ¶
func (m *ComposerMirrorService) CheckPackage( mirrorURL string, packageName string, verbose bool, ) (bool, *ComposerCheckPackageData, error)
func (*ComposerMirrorService) CheckSpeed ¶
func (m *ComposerMirrorService) CheckSpeed( mirrorURL string, timeout int, verbose bool, params ComposerCheckSpeedParams, ) (float64, *ComposerCheckSpeedData, error)
func (*ComposerMirrorService) CheckStatus ¶
func (m *ComposerMirrorService) CheckStatus( url string, verbose bool, ) (bool, *ComposerCheckStatusData, error)
type ConfigDescriptor ¶
type DigestManifest ¶
type DigestManifest struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType"`
Config ConfigDescriptor `json:"config"`
Layers []LayerDescriptor `json:"layers"`
}
type DockerCheckSpeedData ¶
type DockerCheckStatusData ¶
type DockerImageData ¶
type DockerMirrorService ¶
func NewDockerMirrorService ¶
func NewDockerMirrorService() *DockerMirrorService
func (*DockerMirrorService) CheckPackage ¶
func (m *DockerMirrorService) CheckPackage( mirrorUrl, imageName string, ) (bool, *DockerImageData, error)
func (*DockerMirrorService) CheckSpeed ¶
func (m *DockerMirrorService) CheckSpeed( mirrorURL string, timeout int, verbose bool, imgName *string, ) (float64, *DockerCheckSpeedData, error)
func (*DockerMirrorService) CheckStatus ¶
func (m *DockerMirrorService) CheckStatus( url string, ) (bool, *DockerCheckStatusData, error)
type DockerSpeedParams ¶
type DockerSpeedParams struct {
ImageName string
}
type GoCheckPackageData ¶
type GoCheckSpeedData ¶
type GoCheckSpeedParams ¶
type GoCheckStatusData ¶
type GoMirrorService ¶
func NewGoMirrorService ¶
func NewGoMirrorService() *GoMirrorService
NewGoMirrorService creates a new Go module proxy service instance
func (*GoMirrorService) CheckPackage ¶
func (m *GoMirrorService) CheckPackage( mirrorURL string, packageName string, verbose bool, ) (bool, *GoCheckPackageData, error)
func (*GoMirrorService) CheckSpeed ¶
func (m *GoMirrorService) CheckSpeed( mirrorURL string, timeout int, verbose bool, params GoCheckSpeedParams, ) (float64, *GoCheckSpeedData, error)
func (*GoMirrorService) CheckStatus ¶
func (m *GoMirrorService) CheckStatus( url string, verbose bool, ) (bool, *GoCheckStatusData, error)
type GoModuleInfo ¶
type GoModuleInfo struct {
Version string `json:"Version"`
Time string `json:"Time"`
Origin *struct {
VCS string `json:"vcs"`
URL string `json:"url"`
Hash string `json:"hash"`
} `json:"Origin,omitempty"`
}
GoModuleInfo represents the module information from GOPROXY
type HttpRequestError ¶
type HttpRequestError = apt.HttpRequestError
type InvalidMirrorError ¶
type InvalidMirrorError = apt.InvalidMirrorError
type JsonParseError ¶
type JsonParseError = apt.JsonParseError
type LayerDescriptor ¶
type ManifestList ¶
type ManifestList struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType"`
Manifests []Manifest `json:"manifests"`
}
ManifestList Docker manifest structures
type MiravaService ¶
type MiravaService struct {
Apt *AptMirrorService
AptDebian *AptMirrorService
AptUbuntu *AptMirrorService
Npm *NpmMirrorService
PyPi *PyPIMirrorService
Docker *DockerMirrorService
Pacman *PacmanMirrorService
Go *GoMirrorService
Cargo *CargoMirrorService
Composer *ComposerMirrorService
}
type MirrorType ¶
type MirrorType string
const ( MirrorTypeApt MirrorType = "apt" // Debian, Ubuntu, and derivatives (deb repositories) MirrorTypeAptDebian MirrorType = "apt-debian" // Debian package mirrors (deb repositories) MirrorTypeAptUbuntu MirrorType = "apt-ubuntu" // Ubuntu package mirrors (deb repositories) MirrorTypeYum MirrorType = "yum" // RHEL-family RPM repositories (yum / repodata) MirrorTypeDnf MirrorType = "dnf" // DNF-compatible RPM mirrors (often same layout as yum) MirrorTypePacman MirrorType = "pacman" // Arch Linux sync databases / package mirrors MirrorTypeNpm MirrorType = "npm" // npm registry mirrors MirrorTypeGo MirrorType = "go" // Go module proxy / sumdb mirrors (GOPROXY-style) MirrorTypeCargo MirrorType = "cargo" // crates.io / sparse index mirrors MirrorTypePypi MirrorType = "pypi" // Python package index mirrors (PEP 503 / simple) MirrorTypeNuget MirrorType = "nuget" // NuGet V3 feed mirrors MirrorTypeDocker MirrorType = "docker" // OCI distribution / Docker registry mirrors MirrorTypeComposer MirrorType = "composer" // Composer / Packagist mirrors (PHP) )
Supported mirror ecosystems for mirava-core. Each value should eventually have a dedicated MirrorService implementation in pkg/.
type NpmCheckPackageData ¶
type NpmCheckPackageData struct {
Version string
// contains filtered or unexported fields
}
type NpmCheckSpeedData ¶
type NpmCheckSpeedParams ¶
type NpmCheckSpeedParams struct {
PackageName string
}
type NpmCheckStatusData ¶
type NpmMirrorService ¶
func NewNpmMirrorService ¶
func NewNpmMirrorService() *NpmMirrorService
NewNpmMirrorService creates a new NPM mirror service instance
func (*NpmMirrorService) CheckPackage ¶
func (m *NpmMirrorService) CheckPackage( mirrorUrl, packageName string, verbose bool, ) (bool, *NpmCheckPackageData, error)
CheckPackage checks if a package exists on an NPM mirror
func (*NpmMirrorService) CheckSpeed ¶
func (m *NpmMirrorService) CheckSpeed( mirrorURL string, timeout int, verbose bool, packageName *string, ) (float64, *NpmCheckSpeedData, error)
func (*NpmMirrorService) CheckStatus ¶
func (m *NpmMirrorService) CheckStatus( url string, verbose bool, ) (bool, *NpmCheckStatusData, error)
type PackageNotFoundError ¶
type PackageNotFoundError = apt.PackageNotFoundError
type PackageVersion ¶
type PackageVersion struct {
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
License []string `json:"license"`
Homepage string `json:"homepage"`
Time string `json:"time"`
Authors []ComposerAuthor `json:"authors"`
Require map[string]string `json:"require"`
RequireDev map[string]string `json:"require-dev"`
Downloads *ComposerDownloads `json:"downloads"`
Abandoned interface{} `json:"abandoned"`
Version string `json:"version"`
Dist struct {
URL string `json:"url"`
} `json:"dist"`
}
PackageVersion represents a single package version from Composer API
type PacmanCheckPackageData ¶
type PacmanCheckSpeedData ¶
type PacmanCheckSpeedParams ¶
type PacmanCheckStatusData ¶
type PacmanMirrorService ¶
func NewPacmanMirrorService ¶
func NewPacmanMirrorService() *PacmanMirrorService
NewPacmanMirrorService creates a new Pacman mirror service instance
func (*PacmanMirrorService) CheckPackage ¶
func (m *PacmanMirrorService) CheckPackage( mirrorURL, packageName string, verbose bool, ) (bool, *PacmanCheckPackageData, error)
func (*PacmanMirrorService) CheckSpeed ¶
func (m *PacmanMirrorService) CheckSpeed( mirrorURL string, timeout int, verbose bool, ) (float64, *PacmanCheckSpeedData, error)
func (*PacmanMirrorService) CheckStatus ¶
func (m *PacmanMirrorService) CheckStatus( url string, verbose bool, ) (bool, *PacmanCheckStatusData, error)
CheckStatus checks if a Pacman mirror is alive
type PyPIMirrorService ¶
func NewPyPIMirrorService ¶
func NewPyPIMirrorService() *PyPIMirrorService
NewPyPIMirrorService creates a new PyPI mirror service instance
func (*PyPIMirrorService) CheckPackage ¶
func (m *PyPIMirrorService) CheckPackage(mirrorUrl, packageName string, verbose bool) (bool, *PyPiCheckPackageData, error)
CheckPackage checks if a package exists on a PyPI mirror using the simple API Returns: (exists, version, error)
func (*PyPIMirrorService) CheckSpeed ¶
func (m *PyPIMirrorService) CheckSpeed(mirrorURL string, timeout int, verbose bool) (float64, *PyPiCheckSpeedData, error)
func (*PyPIMirrorService) CheckStatus ¶
func (m *PyPIMirrorService) CheckStatus(url string, verbose bool) (bool, *PyPIStatusResponse, error)
CheckStatus checks if a PyPI mirror is alive and responding
type PyPIStatusResponse ¶
type PyPIStatusResponse struct {
Status string `json:"status"` // Status of the mirror (e.g., "active")
TestedPath string `json:"tested_path"` // The endpoint that was tested (e.g., "/simple/")
StatusCode int `json:"status_code"` // HTTP status code from the response
}
PyPIStatusResponse represents the response from checking a PyPI mirror status
type PyPiCheckPackageData ¶
type PyPiCheckSpeedData ¶
type PyPiCheckStatusData ¶
type RegistryInfo ¶
type RegistryInfo struct {
URL string
IsAlive bool
AuthRequired bool
CatalogAccessible bool
APIVersion string
}
RegistryInfo holds detailed information about a Docker registry
type ResponseReadError ¶
type ResponseReadError = apt.ResponseReadError
type SpeedTestError ¶
type SpeedTestError = apt.SpeedTestError
type TimeoutError ¶
type TimeoutError = apt.TimeoutError
type ValidationError ¶
type ValidationError = apt.ValidationError