nodeapi

package
v0.0.0-...-287f055 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeAlreadyAdopted = internalapi.ErrNodeAlreadyAdopted

Functions

func DynamicCertificateLoader

func DynamicCertificateLoader(certPath, keyPath string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)

Types

type AdoptRequest

type AdoptRequest = internalapi.AdoptRequest

type AdoptResponse

type AdoptResponse = internalapi.AdoptResponse

type AdoptedUpdater

type AdoptedUpdater interface {
	UpdateAdopted(bool)
}

type Adopter

type Adopter interface {
	ApplyAdoption(context.Context, AdoptRequest) (AdoptResponse, error)
}

type Checker

type Checker = updates.Checker

Checker is the standalone update checker/installer, re-exported so callers outside internal/api can construct and inject one.

type InventoryCredentialsUpdater

type InventoryCredentialsUpdater interface {
	UpdateNUTCredentials(string, string)
}

type Options

type Options struct {
	Version        string
	Serial         string
	StartedAt      time.Time
	Runner         Runner
	UPSCPath       string
	UPSCmdPath     string
	UPSRWPath      string
	CPUTempPath    string
	MemInfoPath    string
	CPUStatPath    string
	RootPath       string
	AdoptionPath   string
	DisableAuth    bool
	AuthPath       string
	UpdatesRoot    string
	UpdatesChecker *updates.Checker
	NUTUser        string
	NUTPassword    string
	Adopter        Adopter
}

type Reloader

type Reloader interface {
	Reload(context.Context, bool, []string) error
}

type Runner

type Runner interface {
	CombinedOutput(context.Context, string, ...string) ([]byte, error)
}

type RuntimeAdopter

type RuntimeAdopter struct {
	Logger       *log.Logger
	ConfigDir    string
	AdoptionPath string
	Reloader     Reloader
	Advertiser   AdoptedUpdater
	Inventory    InventoryCredentialsUpdater
	Version      string
	Serial       string
	TLSPort      int
	TLSCertPath  string
	TLSKeyPath   string
}

func (*RuntimeAdopter) ApplyAdoption

func (a *RuntimeAdopter) ApplyAdoption(ctx context.Context, req AdoptRequest) (AdoptResponse, error)

type Service

type Service = internalapi.Service

func New

func New(logger *log.Logger, opts Options) *Service

type Store

type Store = updates.Store

Store is the durable release-slot store, re-exported so callers outside internal/api can construct and inject one.

Jump to

Keyboard shortcuts

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