Documentation
¶
Index ¶
- Constants
- type BinaryCache
- type BinaryCacheEntry
- type BinaryDownloader
- type Config
- func (cfg *Config) GetBinaryPrefix() string
- func (cfg *Config) GetCacheName() string
- func (cfg *Config) GetGitHubAPIURL() string
- func (cfg *Config) GetGitHubReleasesURL() string
- func (cfg *Config) GetSigstoreIdentityRegexp() string
- func (cfg *Config) GetSigstoreOIDCIssuer() string
- func (cfg *Config) GetVerbose() bool
- type SigstoreVerifier
Constants ¶
const ( DefaultCacheName = ".genmcp" DefaultBinaryPrefix = "genmcp-server" DefaultGitHubReleasesURL = "https://github.com/genmcp/gen-mcp/releases/download" DefaultGitHubAPIURL = "https://api.github.com/repos/genmcp/gen-mcp/releases/latest" DefaultSigstoreIdentityRegexp = "https://github.com/genmcp/gen-mcp/.*" DefaultSigstoreOIDCIssuer = "https://token.actions.githubusercontent.com" DefaultVerbose = false )
const (
CacheKeepVersionsCount = 3 // Number of versions to keep per platform in cache
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryCache ¶
type BinaryCache struct {
// contains filtered or unexported fields
}
BinaryCache manages cached server binaries
func NewBinaryCache ¶
func NewBinaryCache(cfg *Config) (*BinaryCache, error)
NewBinaryCache creates a new binary cache manager using the default user cache dir and the provided name for the cache
func NewBinaryCacheWithDir ¶
func NewBinaryCacheWithDir(cacheDir, prefix string) (*BinaryCache, error)
NewBinaryCacheWithDir creates a new binary cache manager with a custom cache directory
func (*BinaryCache) Add ¶
func (bc *BinaryCache) Add(version, platform, sourcePath string) (string, error)
Add adds a binary zip file to the cache
func (*BinaryCache) Clean ¶
func (bc *BinaryCache) Clean(keepVersions int) error
Clean removes old cached binaries (keeps last N versions)
func (*BinaryCache) Get ¶
func (bc *BinaryCache) Get(version, platform string) (string, bool)
Get retrieves a cached binary path for a version and platform
func (*BinaryCache) GetLatestCached ¶
func (bc *BinaryCache) GetLatestCached(platform string) (string, string)
GetLatestCached returns the most recently cached version for a platform
type BinaryCacheEntry ¶
type BinaryCacheEntry struct {
Version string `json:"version"`
Platform string `json:"platform"` // e.g., "linux-amd64"
ZipPath string `json:"zip_path"` // absolute path to verified zip file
SHA256 string `json:"sha256"` // checksum of zip file
DownloadedAt string `json:"downloaded_at"` // timestamp
}
BinaryCacheEntry represents a cached binary
type BinaryDownloader ¶
type BinaryDownloader struct {
// contains filtered or unexported fields
}
BinaryDownloader handles downloading server binaries from GitHub releases
func NewBinaryDownloader ¶
func NewBinaryDownloader(cfg *Config) (*BinaryDownloader, error)
NewBinaryDownloader creates a new binary downloader
func (*BinaryDownloader) CleanOldBinaries ¶
func (bd *BinaryDownloader) CleanOldBinaries(keepVersions int) error
CleanOldBinaries removes old cached binaries (keeps last N versions)
func (*BinaryDownloader) GetBinary ¶
func (bd *BinaryDownloader) GetBinary(version, goos, goarch string) (string, error)
GetBinary retrieves a server binary for the specified version and platform Returns the path to the binary file
func (*BinaryDownloader) GetCurrentBinary ¶
func (bd *BinaryDownloader) GetCurrentBinary(version string) (string, error)
GetCurrentBinary gets the binary for the current platform and a specific version
type Config ¶
type Config struct {
CacheName string // e.g. ".genmcp"
BinaryPrefix string // e.g. "genmcp-server"
GitHubReleasesURL string
GitHubAPIURL string
SigstoreIdentityRegexp string
SigstoreOIDCIssuer string
Verbose bool // whether to log out verbose outputs
}
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) GetBinaryPrefix ¶
func (*Config) GetCacheName ¶
func (*Config) GetGitHubAPIURL ¶
func (*Config) GetGitHubReleasesURL ¶
func (*Config) GetSigstoreIdentityRegexp ¶
func (*Config) GetSigstoreOIDCIssuer ¶
func (*Config) GetVerbose ¶
type SigstoreVerifier ¶
type SigstoreVerifier struct {
// contains filtered or unexported fields
}
SigstoreVerifier verifies binaries using sigstore-go library
func NewSigstoreVerifier ¶
func NewSigstoreVerifier(cfg *Config) (*SigstoreVerifier, error)
NewSigstoreVerifier creates a new sigstore verifier using the public good instance
func (*SigstoreVerifier) VerifyBlob ¶
func (sv *SigstoreVerifier) VerifyBlob(blobPath, bundlePath string) error
VerifyBlob verifies a blob (file) using a sigstore bundle