infra

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package infra implements infrastructure probing for known endpoints (Ollama instances, Samverk services, Gitea) and synchronises the results with Synapset machine memories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Name   string // human-readable name (e.g. "vm-300")
	URL    string // base URL (e.g. "http://192.168.1.207:11434")
	Kind   string // "ollama", "samverk", "gitea"
	Source string // Synapset source key for query_memory
}

Endpoint describes a single infrastructure endpoint to probe.

func DefaultEndpoints

func DefaultEndpoints() []Endpoint

DefaultEndpoints returns the standard set of infrastructure endpoints.

type ProbeResult

type ProbeResult struct {
	Endpoint  Endpoint
	Reachable bool
	Error     string            // non-empty when Reachable is false
	Fields    map[string]string // key-value pairs of probed state
}

ProbeResult holds the state captured from a single endpoint probe.

type Prober

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

Prober polls infrastructure endpoints and syncs findings to Synapset.

func NewProber

func NewProber(sc *synapset.Client, logger *zap.Logger, endpoints []Endpoint) *Prober

NewProber creates a Prober with the given Synapset client and endpoints.

func (*Prober) Run

func (p *Prober) Run(ctx context.Context) []ProbeResult

Run probes all endpoints and syncs meaningful changes to Synapset. It returns the results for each endpoint. Unreachable hosts are logged and skipped without aborting the remaining probes.

Jump to

Keyboard shortcuts

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