update

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package update verifies signed release manifests before executing staged binaries.

Index

Constants

View Source
const Repository = "VanSail-Opensource/X-Node"

Variables

This section is empty.

Functions

func PublicKey

func PublicKey() ([]byte, error)

func Verify

func Verify(manifest, signature []byte, version string) (map[string]string, error)

func VerifyFile

func VerifyFile(path, hash string) error

func VerifyWithKey

func VerifyWithKey(keyText, manifest, signature []byte, version string) (map[string]string, error)

Types

type Manager

type Manager struct {
	Dir      string
	Current  string
	Runner   host.Runner
	Client   *http.Client
	NodePath string
	CLIPath  string
	// contains filtered or unexported fields
}

func New

func New(dir, current string, runner host.Runner) *Manager

func (*Manager) Check

func (m *Manager) Check(ctx context.Context, version string) (Release, error)

func (*Manager) Confirm

func (m *Manager) Confirm(ctx context.Context) error

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, id, version string, progress func(any)) (Release, error)

func (*Manager) Pending added in v1.0.2

func (m *Manager) Pending() bool

Pending reports whether the current binary still depends on its rollback watchdog.

func (*Manager) Rollback

func (m *Manager) Rollback(ctx context.Context) error

func (*Manager) RollbackPending

func (m *Manager) RollbackPending(ctx context.Context) error

func (*Manager) Status

func (m *Manager) Status() any

type Release

type Release struct {
	Version   string `json:"version"`
	Current   string `json:"current"`
	Available bool   `json:"available"`
}

type Transaction

type Transaction struct {
	ID       string    `json:"id"`
	Version  string    `json:"version"`
	Previous string    `json:"previous"`
	Status   string    `json:"status"`
	Deadline time.Time `json:"deadline"`
	Unit     string    `json:"unit"`
	NodePath string    `json:"node_path"`
	CLIPath  string    `json:"cli_path"`
}

Jump to

Keyboard shortcuts

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