nodeavailability

package
v0.0.0-...-0b698e0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Overview

Package nodeavailability holds owner-declared advisory availability. A profile never changes trust, resource admission, expiry, execution or settlement.

Index

Constants

View Source
const Capability = "node-availability-v1"
View Source
const MaxDocumentBytes = 8 << 10
View Source
const MetadataKey = "node_availability_v1"

Variables

This section is empty.

Functions

func DecodeHost

func DecodeHost(raw []byte) (string, error)

func DecodeReadTarget

func DecodeReadTarget(raw []byte) (string, error)

Targets use the existing native registry resolver, never a private alias map. Browser node contexts still pass their exact selected canonical ID.

func ValidProfile

func ValidProfile(profile string) bool

Types

type Declaration

type Declaration struct {
	Profile   string     `json:"profile"`
	Revision  uint64     `json:"revision"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type Document

type Document struct {
	Schema     int       `json:"schema"`
	Host       string    `json:"host"`
	Owner      string    `json:"owner"`
	Revision   uint64    `json:"revision"`
	Profile    string    `json:"profile"`
	Reason     string    `json:"reason"`
	UpdatedAt  time.Time `json:"updated_at"`
	LastUpdate Update    `json:"last_update"`
}

func DecodeDocument

func DecodeDocument(raw []byte, host, owner string) (Document, error)

DecodeDocument accepts only the exact canonical private metadata producer. Missing metadata is handled separately and never creates a startup write.

func (Document) Report

func (d Document) Report(host string) Report

type Inspection

type Inspection struct {
	Schema           int            `json:"schema"`
	Host             string         `json:"host"`
	OwnerDeclared    *Declaration   `json:"owner_declared,omitempty"`
	DeclarationState string         `json:"declaration_state"`
	ConnectionState  string         `json:"connection_state"`
	Failure          string         `json:"failure,omitempty"`
	LastSuccess      *time.Time     `json:"last_success_at,omitempty"`
	NextAttempt      *time.Time     `json:"next_attempt_at,omitempty"`
	Resources        ResourceStates `json:"resource_freshness"`
}

Inspection is the proposed optional local-gateway projection for one exact chosen node. It describes observations, never eligibility or a resource grant.

type Report

type Report struct {
	Schema        int         `json:"schema"`
	Host          string      `json:"host"`
	OwnerDeclared Declaration `json:"owner_declared"`
	ObservedAt    time.Time   `json:"observed_at"`
}

func DecodeReport

func DecodeReport(raw []byte, host string) (Report, error)

type ResourceStates

type ResourceStates struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
	Disk   string `json:"disk"`
}

type Update

type Update struct {
	Key              string `json:"key"`
	ExpectedRevision uint64 `json:"expected_revision"`
	Profile          string `json:"profile"`
	Reason           string `json:"reason"`
}

func DecodeUpdate

func DecodeUpdate(raw []byte) (Update, error)

func (Update) Validate

func (u Update) Validate() error

Jump to

Keyboard shortcuts

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