development

package
v0.69.5-nightly Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: AGPL-3.0 Imports: 19 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(debrosDir 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 // bootstrap, bootstrap2, node2, node3, node4
	Role              string // "bootstrap" or "node"
	ConfigFilename    string // bootstrap.yaml, bootstrap2.yaml, node2.yaml, etc.
	DataDir           string // relative path from .debros 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
	RQLiteJoinTarget  string // which bootstrap RQLite port to join (leave empty for bootstraps that lead)
	ClusterJoinTarget string // which bootstrap cluster to join (leave empty for bootstrap that leads)
}

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(debrosDir 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) GetBootstrapNodes

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

GetBootstrapNodes returns only the bootstrap nodes

func (*Topology) GetNodeByName

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

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

func (*Topology) GetRegularNodes

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

GetRegularNodes returns only the regular (non-bootstrap) nodes

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