development

package
v0.72.0-nightly Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequiredPorts = DefaultTopology().AllPorts()

RequiredPorts defines all ports needed for dev environment Computed from DefaultTopology

Functions

func PortMap

func PortMap() map[int]string

PortMap provides a human-readable mapping of ports to services

Types

type ConfigEnsurer

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

ConfigEnsurer handles all config file creation and validation

func NewConfigEnsurer

func NewConfigEnsurer(oramaDir string) *ConfigEnsurer

NewConfigEnsurer creates a new config ensurer

func (*ConfigEnsurer) EnsureAll

func (ce *ConfigEnsurer) EnsureAll() error

EnsureAll ensures all necessary config files and secrets exist

type Dependency

type Dependency struct {
	Name        string
	Command     string
	MinVersion  string // Optional: if set, try to check version
	InstallHint string
}

Dependency represents an external binary dependency

type DependencyChecker

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

DependencyChecker handles dependency validation

func NewDependencyChecker

func NewDependencyChecker() *DependencyChecker

NewDependencyChecker creates a new dependency checker

func (*DependencyChecker) CheckAll

func (dc *DependencyChecker) CheckAll() ([]string, error)

CheckAll performs all dependency checks and returns a report

type HealthCheckResult

type HealthCheckResult struct {
	Name    string
	Healthy bool
	Details string
}

HealthCheckResult represents the result of a health check

type ManagedProcess

type ManagedProcess struct {
	Name      string
	PID       int
	StartTime time.Time
	LogPath   string
}

ManagedProcess tracks a running process

type NodeSpec

type NodeSpec struct {
	Name               string // node-1, node-2, node-3, node-4, node-5
	ConfigFilename     string // node-1.yaml, node-2.yaml, etc.
	DataDir            string // relative path from .orama root
	P2PPort            int    // LibP2P listen port
	IPFSAPIPort        int    // IPFS API port
	IPFSSwarmPort      int    // IPFS Swarm port
	IPFSGatewayPort    int    // IPFS HTTP Gateway port
	RQLiteHTTPPort     int    // RQLite HTTP API port
	RQLiteRaftPort     int    // RQLite Raft consensus port
	ClusterAPIPort     int    // IPFS Cluster REST API port
	ClusterPort        int    // IPFS Cluster P2P port
	UnifiedGatewayPort int    // Unified gateway port (proxies all services)
	RQLiteJoinTarget   string // which node's RQLite Raft port to join (empty for first node)
	ClusterJoinTarget  string // which node's cluster to join (empty for first node)
}

NodeSpec defines configuration for a single dev environment node

type PortChecker

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

PortChecker validates that required ports are available

func NewPortChecker

func NewPortChecker() *PortChecker

NewPortChecker creates a new port checker with required ports

func (*PortChecker) CheckAll

func (pc *PortChecker) CheckAll() ([]int, error)

CheckAll verifies all required ports are available

type ProcessManager

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

ProcessManager manages all dev environment processes

func NewProcessManager

func NewProcessManager(oramaDir string, logWriter io.Writer) *ProcessManager

NewProcessManager creates a new process manager

func (*ProcessManager) HealthCheckWithRetry

func (pm *ProcessManager) HealthCheckWithRetry(ctx context.Context, nodes []ipfsNodeInfo, retries int, retryInterval time.Duration, timeout time.Duration) bool

HealthCheckWithRetry performs a health check with retry logic

func (*ProcessManager) IPFSHealthCheck

func (pm *ProcessManager) IPFSHealthCheck(ctx context.Context, nodes []ipfsNodeInfo) HealthCheckResult

IPFSHealthCheck verifies IPFS peer connectivity

func (*ProcessManager) LibP2PHealthCheck

func (pm *ProcessManager) LibP2PHealthCheck(ctx context.Context) HealthCheckResult

LibP2PHealthCheck verifies that network nodes have peer connections

func (*ProcessManager) RQLiteHealthCheck

func (pm *ProcessManager) RQLiteHealthCheck(ctx context.Context) HealthCheckResult

RQLiteHealthCheck verifies RQLite cluster formation

func (*ProcessManager) StartAll

func (pm *ProcessManager) StartAll(ctx context.Context) error

StartAll starts all development services

func (*ProcessManager) Status

func (pm *ProcessManager) Status(ctx context.Context)

Status reports the status of all services

func (*ProcessManager) StopAll

func (pm *ProcessManager) StopAll(ctx context.Context) error

StopAll stops all running processes

type Topology

type Topology struct {
	Nodes           []NodeSpec
	GatewayPort     int
	OlricHTTPPort   int
	OlricMemberPort int
	AnonSOCKSPort   int
}

Topology defines the complete development environment topology

func DefaultTopology

func DefaultTopology() *Topology

DefaultTopology returns the default five-node dev environment topology

func (*Topology) AllPorts

func (t *Topology) AllPorts() []int

AllPorts returns a slice of all ports used in the topology

func (*Topology) GetFirstNode added in v0.72.0

func (t *Topology) GetFirstNode() *NodeSpec

GetFirstNode returns the first node (the one that creates the cluster)

func (*Topology) GetJoiningNodes added in v0.72.0

func (t *Topology) GetJoiningNodes() []NodeSpec

GetJoiningNodes returns all nodes except the first one (they join the cluster)

func (*Topology) GetNodeByName

func (t *Topology) GetNodeByName(name string) *NodeSpec

GetNodeByName returns a node by its name, or nil if not found

func (*Topology) PortMap

func (t *Topology) PortMap() map[int]string

PortMap returns a human-readable mapping of ports to services

Jump to

Keyboard shortcuts

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