selfupdate

package
v0.6.28 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNoNewRelease warpnet.WarpError = "no new release found"

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is a Linux-only self-update service for the bootstrap node. It responds to internal trigger() calls issued via ObservedHigherVersion. When triggered, it checks GitHub for a newer release and replaces the running binary if one is found, then exits so the supervisor can restart the process with the new version.

func NewService

func NewService(
	ctx context.Context,
	currentVersion string,
	interruptChan chan<- os.Signal,
) *Service

NewService creates a new self-update service for the given version string.

func (*Service) ObservedHigherVersion

func (s *Service) ObservedHigherVersion(peerID string)

ObservedHigherVersion records that the peer identified by peerID is running a higher version than this node. Each peer is counted at most once; once peerVersionThreshold distinct peers have been recorded, a self-update is triggered exactly once.

func (*Service) Run

func (s *Service) Run()

Run starts the service in a background goroutine. It listens for calls to trigger() (issued via ObservedHigherVersion).

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

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