Documentation
¶
Index ¶
- Constants
- Variables
- func CrossCompile(opts CrossCompileOpts) error
- func DownloadLatestRelease(arch, destPath string) error
- func DownloadRelease(ver, arch, destPath string) error
- func ExtractFullsendFromTarGz(r io.Reader, destPath string) error
- func FetchSourceTree(version, destDir string) error
- func IsReleasedVersion(v string) bool
- func ModuleRoot() (string, error)
- func ResolveExplicit(path, arch string) error
- func ValidArch(arch string) bool
- func ValidateLinuxBinary(path, arch string) error
- func ValidateSourceRoot(dir string) error
- type AcquireResult
- type CrossCompileOpts
- type Source
- type VendorOpts
- type VendorRoot
Constants ¶
const DefaultArch = "amd64"
DefaultArch is the architecture used for vendored binaries (linux/amd64 GHA runners).
Variables ¶
var HTTPClient = &http.Client{Timeout: 120 * time.Second}
HTTPClient is used for release downloads. Tests may override. Not safe for concurrent test mutation.
var ReleaseBaseURL = "https://github.com/fullsend-ai/fullsend/releases/download"
ReleaseBaseURL is the GitHub releases download base URL. Tests may override. Not safe for concurrent test mutation.
var SourceArchiveBaseURL = "https://github.com/fullsend-ai/fullsend/archive/refs/tags"
SourceArchiveBaseURL is the GitHub source archive base URL. Tests may override.
Functions ¶
func CrossCompile ¶
func CrossCompile(opts CrossCompileOpts) error
CrossCompile builds a Linux fullsend binary and writes it to DestPath. Requires the Go toolchain and a fullsend module checkout (go env GOMOD).
func DownloadLatestRelease ¶
DownloadLatestRelease resolves the latest release tag from the GitHub API and downloads the Linux binary for the given arch.
func DownloadRelease ¶
DownloadRelease downloads the fullsend binary for linux/{arch} from the GitHub Release matching the given version, verifies its SHA256 checksum against the release checksums.txt, and writes it to destPath.
func ExtractFullsendFromTarGz ¶
ExtractFullsendFromTarGz reads a tar.gz stream and extracts the "fullsend" binary to destPath.
func FetchSourceTree ¶ added in v0.19.0
FetchSourceTree downloads the fullsend source tree for the given release version and extracts it into destDir (module root contents, not wrapped).
func IsReleasedVersion ¶
IsReleasedVersion returns true if version looks like a release tag (e.g. "0.4.0", "v0.4.0") rather than a dev build (e.g. "dev", "0.4.0-3-gabcdef", "0.4.0-vendored").
func ModuleRoot ¶
ModuleRoot returns the fullsend module root directory, or an error if not inside a Go module checkout.
func ResolveExplicit ¶
ResolveExplicit validates that path is a Linux ELF for arch.
func ValidateLinuxBinary ¶
ValidateLinuxBinary checks that the file at path is a Linux ELF executable for the expected architecture. Returns a descriptive error if the file is missing, not ELF, not Linux, or the wrong architecture.
func ValidateSourceRoot ¶ added in v0.19.0
ValidateSourceRoot checks that dir is a fullsend module checkout.
Types ¶
type AcquireResult ¶
type AcquireResult struct {
TmpDir string // caller must RemoveAll when non-empty
Path string
Source Source
}
AcquireResult holds the path to an acquired binary and metadata for callers.
func ResolveForRun ¶
func ResolveForRun(version, arch string) (AcquireResult, error)
ResolveForRun obtains a Linux binary using the run policy: release download (if released) → cross-compile → latest release.
func ResolveForVendor ¶
func ResolveForVendor(opts VendorOpts) (AcquireResult, error)
ResolveForVendor obtains a Linux binary using the vendoring policy: cross-compile from resolved source root → matching release (released CLI only) → fail.
func ResolveForVendorFromRoot ¶ added in v0.19.0
func ResolveForVendorFromRoot(rootPath, version, arch string) (AcquireResult, error)
ResolveForVendorFromRoot cross-compiles from an already-resolved source tree, falling back to release download when cross-compilation is unavailable.
type CrossCompileOpts ¶
type CrossCompileOpts struct {
Version string // CLI version to embed (before stamp suffix)
Arch string
DestPath string
VersionStamp string // e.g. "-vendored", "-crosscompiled", or ""
SourceDir string // optional module root; defaults to ModuleRoot()
}
CrossCompileOpts configures a cross-compilation build.
type VendorOpts ¶ added in v0.19.0
VendorOpts configures binary resolution for vendoring.
type VendorRoot ¶ added in v0.19.0
type VendorRoot struct {
Path string
Cleanup func()
}
VendorRoot holds a resolved fullsend source tree for vendoring.
func ResolveVendorRoot ¶ added in v0.19.0
func ResolveVendorRoot(sourceDir, version string) (VendorRoot, error)
ResolveVendorRoot resolves a fullsend source tree for vendoring content and cross-compilation. Precedence: explicit sourceDir → ModuleRoot() → GitHub source fetch (released CLI only).