httpapi

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMux

func NewMux(version string) http.Handler

func NewMuxWithOptions

func NewMuxWithOptions(opts Options) http.Handler

Types

type HealthResponse

type HealthResponse struct {
	Status  string `json:"status"`
	Version string `json:"version"`
}

type Options

type Options struct {
	Version                string
	Registration           registration.Service
	SessionStore           SessionStore
	TokenSigner            auth.TokenSigner
	ProtocolValidator      *protocol.Validator
	JobService             *jobs.Service
	OperatorStore          *operatorstore.Store
	CatalogDir             string
	OperatorToken          string
	HeartbeatInterval      time.Duration
	StatusCacheTTL         time.Duration
	RequesterRegionHeader  string
	WaitlistLimitPerMinute int
	Now                    func() time.Time
	Logger                 *slog.Logger
}

type SessionStore

type SessionStore interface {
	OpenSession(ctx context.Context, nodeID, protocolVersion, remoteAddr string, now time.Time) (string, error)
	RecordHeartbeat(ctx context.Context, sessionID string, heartbeat protocol.NodeHeartbeatPayload, receivedAt time.Time) error
	RecordStateChanged(ctx context.Context, stateChanged protocol.NodeStateChangedPayload, receivedAt time.Time) error
	RecordSafetyEvent(ctx context.Context, event protocol.NodeSafetyEventPayload, receivedAt time.Time) error
	CloseSession(ctx context.Context, sessionID, nodeID string, now time.Time) error
	ListNodes(ctx context.Context) ([]registration.NodeSummary, error)
	PublicKeyForNode(ctx context.Context, nodeID string) (string, error)
}

Jump to

Keyboard shortcuts

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