core

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package core defines the core domain types and interfaces used across all colony2 modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Path         string   `json:"path"`
	Type         string   `json:"type"`
	Dependencies []string `json:"dependencies"` // List of cell IDs this cell depends on
}

Cell represents a single cell in the dependency graph.

type CellName

type CellName string

type Edge

type Edge struct {
	ID     string `json:"id"`
	Source string `json:"source"` // Cell ID of the source
	Target string `json:"target"` // Cell ID of the target
}

Edge represents a directed edge in the dependency graph.

type Graph

type Graph struct {
	Cells []Cell `json:"cells"`
	Edges []Edge `json:"edges"`
}

Graph represents the complete dependency graph.

type GraphBuilder

type GraphBuilder interface {
	// BuildGraph constructs the dependency graph from the file system.
	BuildGraph(ctx context.Context) (*Graph, error)

	// GetCell retrieves a single cell by ID.
	GetCell(ctx context.Context, cellID string) (*Cell, error)
}

GraphBuilder defines the interface for building the dependency graph.

type Position

type Position struct {
	CellID string  `json:"cellId"`
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
}

Position represents the visual position of a cell in the UI.

type Storage

type Storage interface {
	// Position operations
	SavePosition(ctx context.Context, pos Position) error
	GetPositions(ctx context.Context) ([]Position, error)
	DeletePosition(ctx context.Context, cellID string) error

	// Container ID operations
	SaveContainerID(ctx context.Context, cellID, containerID string) error
	GetContainerID(ctx context.Context, cellID string) (string, error)
	DeleteContainerID(ctx context.Context, cellID string) error

	// Lifecycle
	Close() error
}

Storage defines the interface for persistent storage operations.

Jump to

Keyboard shortcuts

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