binary

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultArch = "amd64"

DefaultArch is the architecture used for vendored binaries (linux/amd64 GHA runners).

Variables

View Source
var HTTPClient = &http.Client{Timeout: 120 * time.Second}

HTTPClient is used for release downloads. Tests may override. Not safe for concurrent test mutation.

View Source
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.

View Source
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

func DownloadLatestRelease(arch, destPath string) error

DownloadLatestRelease resolves the latest release tag from the GitHub API and downloads the Linux binary for the given arch.

func DownloadRelease

func DownloadRelease(ver, arch, destPath string) error

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

func ExtractFullsendFromTarGz(r io.Reader, destPath string) error

ExtractFullsendFromTarGz reads a tar.gz stream and extracts the "fullsend" binary to destPath.

func FetchSourceTree added in v0.19.0

func FetchSourceTree(version, destDir string) error

FetchSourceTree downloads the fullsend source tree for the given release version and extracts it into destDir (module root contents, not wrapped).

func IsReleasedVersion

func IsReleasedVersion(v string) bool

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

func ModuleRoot() (string, error)

ModuleRoot returns the fullsend module root directory, or an error if not inside a Go module checkout.

func ResolveExplicit

func ResolveExplicit(path, arch string) error

ResolveExplicit validates that path is a Linux ELF for arch.

func ValidArch

func ValidArch(arch string) bool

ValidArch reports whether arch is a supported linux target (amd64 or arm64).

func ValidateLinuxBinary

func ValidateLinuxBinary(path, arch string) error

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

func ValidateSourceRoot(dir string) error

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 Source

type Source int

Source identifies how a Linux fullsend binary was obtained.

const (
	SourceExplicitPath Source = iota
	SourceCheckoutBuild
	SourceReleaseDownload
)

type VendorOpts added in v0.19.0

type VendorOpts struct {
	SourceDir string
	Version   string
	Arch      string
}

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).

Jump to

Keyboard shortcuts

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