inject

package
v1.15.1-beta.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmdUrl             = config.BinaryName + "-linux-amd64"
	ArmUrl             = config.BinaryName + "-linux-arm64"
	BinNamePlaceholder = "${BIN_NAME}"
)

Variables

View Source
var Script string

Functions

func GenerateScript

func GenerateScript(script string, params *Params) (string, error)

func Inject

func Inject(ctx context.Context, opts InjectOptions) (bool, error)

Inject runs the inject.sh handshake and bridges the caller's stdio to the exec's stdio. It returns true if the handshake completed and the exec was started, false if the handshake failed and the exec was not started.

Types

type DownloadURLs

type DownloadURLs struct {
	Base string
	Amd  string
	Arm  string
}

func NewDownloadURLs

func NewDownloadURLs(baseUrl string) *DownloadURLs

type ExecFunc

type ExecFunc func(ctx context.Context, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

type InjectOptions

type InjectOptions struct {
	Exec         ExecFunc
	LocalFile    LocalFile
	ScriptParams *Params
	Stdin        io.Reader
	Stdout       io.Writer
	Stderr       io.Writer
	Timeout      time.Duration
}

type LocalFile

type LocalFile func(arm bool) (io.ReadCloser, error)

type Params

type Params struct {
	Command         string
	AgentRemotePath string
	DownloadURLs    *DownloadURLs

	ExistsCheck         string
	PreferAgentDownload bool
	ShouldChmodPath     bool
}

func (*Params) ChmodPath

func (p *Params) ChmodPath() string

func (*Params) InstallDir

func (p *Params) InstallDir() string

func (*Params) InstallFilename

func (p *Params) InstallFilename() string

func (*Params) PreferDownload

func (p *Params) PreferDownload() string

Jump to

Keyboard shortcuts

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