toolchain

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package toolchain manages the Go compiler for building standalone exploits. Auto-downloads Go if not available on the system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(opts BuildOpts) error

Build compiles a Go program. Downloads the toolchain if needed.

func RenderToFile

func RenderToFile(path, tplName string, data any) error

RenderToFile renders a template to a file.

func Scaffold

func Scaffold(opts ScaffoldOpts) (string, func(), error)

Scaffold creates a temp directory with main.go and go.mod for a standalone build. Returns the dir path and a cleanup function.

Types

type BuildOpts

type BuildOpts struct {
	Dir    string // source directory (contains main.go + go.mod)
	Output string // output binary path
	OS     string // GOOS (empty = native)
	Arch   string // GOARCH (empty = native)
}

BuildOpts configures a compilation.

type ScaffoldOpts added in v0.1.3

type ScaffoldOpts struct {
	ImportPath string // Go import path of the module package
	Proto      string // Protocol to import: "http" or "tcp"
	ModRoot    string // Local repo root (empty = fetch from proxy)
	Version    string // Module version tag (used when ModRoot is empty)
}

ScaffoldOpts configures standalone scaffold generation.

Jump to

Keyboard shortcuts

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