core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapConfig

func BootstrapConfig(settings config.Settings) ([]byte, error)

func DetectVersion

func DetectVersion(ctx context.Context, runner CommandRunner, binaryPath string) (string, error)

func EnsureRuntimeConfig

func EnsureRuntimeConfig(path string, settings config.Settings) error

func ParseVersion

func ParseVersion(output string) (string, error)

func ValidateConfig

func ValidateConfig(ctx context.Context, runner CommandRunner, binaryPath, dataDir, configPath string) error

func WriteBootstrapConfig

func WriteBootstrapConfig(path string, settings config.Settings) error

Types

type Asset

type Asset struct {
	Name   string `json:"name"`
	URL    string `json:"browser_download_url"`
	Size   int64  `json:"size"`
	Digest string `json:"digest"`
}

func SelectAsset

func SelectAsset(release Release, goos, goarch string) (Asset, error)

type Candidate

type Candidate struct {
	// contains filtered or unexported fields
}

func (*Candidate) Cleanup

func (c *Candidate) Cleanup()

func (*Candidate) Commit

func (c *Candidate) Commit() (InstallResult, error)

func (*Candidate) Updated

func (c *Candidate) Updated() bool

func (*Candidate) Version

func (c *Candidate) Version() string

type CommandRunner

type CommandRunner interface {
	Run(context.Context, string, ...string) ([]byte, error)
}

type InstallRequest

type InstallRequest struct {
	BinaryPath     string
	DataDir        string
	ConfigPath     string
	StagingDir     string
	CurrentVersion string
}

type InstallResult

type InstallResult struct {
	Version string
	Updated bool
}

type Installer

type Installer struct {
	HTTPClient *http.Client
	APIBase    string
	Repository string
	GOOS       string
	GOARCH     string
	Runner     CommandRunner
}

func (Installer) Install

func (i Installer) Install(ctx context.Context, request InstallRequest) (InstallResult, error)

func (Installer) Prepare

func (i Installer) Prepare(ctx context.Context, request InstallRequest) (PreparedCore, error)

type OSCommandRunner

type OSCommandRunner struct{}

func (OSCommandRunner) Run

func (OSCommandRunner) Run(ctx context.Context, name string, args ...string) ([]byte, error)

type PreparedCore

type PreparedCore interface {
	Version() string
	Updated() bool
	Commit() (InstallResult, error)
	Cleanup()
}

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Assets  []Asset `json:"assets"`
}

Jump to

Keyboard shortcuts

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