catalog

package
v0.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCatalogURL is the URL to download the catalog from GitHub main branch
	// Using GitHub's automatic tarball generation for the main branch
	DefaultCatalogURL = "https://github.com/dokulabs/doku-catalog/archive/refs/heads/main.tar.gz"
	CatalogFileName   = "catalog.yaml"
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst

Types

type CatalogMetadata

type CatalogMetadata struct {
	Version       string `yaml:"version"`
	Format        string `yaml:"format"`
	SchemaVersion string `yaml:"catalog_schema_version"`
}

CatalogMetadata represents the root catalog.yaml structure

type HierarchicalLoader

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

HierarchicalLoader loads catalog from hierarchical YAML structure

func NewHierarchicalLoader

func NewHierarchicalLoader(catalogDir string) *HierarchicalLoader

NewHierarchicalLoader creates a new hierarchical catalog loader

func (*HierarchicalLoader) ListCategories

func (l *HierarchicalLoader) ListCategories() ([]string, error)

ListCategories returns all available categories

func (*HierarchicalLoader) ListServicesByCategory

func (l *HierarchicalLoader) ListServicesByCategory(category string) ([]string, error)

ListServicesByCategory lists all services in a category

func (*HierarchicalLoader) Load

Load loads the complete catalog from hierarchical structure

type Manager

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

Manager handles catalog operations

func NewManager

func NewManager(catalogDir string) *Manager

NewManager creates a new catalog manager

func (*Manager) CatalogExists

func (m *Manager) CatalogExists() bool

CatalogExists checks if the catalog file exists

func (*Manager) FetchCatalog

func (m *Manager) FetchCatalog() error

FetchCatalog downloads and extracts the hierarchical catalog

func (*Manager) GetCatalogDir

func (m *Manager) GetCatalogDir() string

GetCatalogDir returns the catalog directory path

func (*Manager) GetCatalogPath

func (m *Manager) GetCatalogPath() string

GetCatalogPath returns the path to the local catalog file

func (*Manager) GetCatalogVersion

func (m *Manager) GetCatalogVersion() (string, error)

GetCatalogVersion returns the version of the loaded catalog

func (*Manager) GetService

func (m *Manager) GetService(serviceName string) (*types.CatalogService, error)

GetService retrieves a specific service from the catalog

func (*Manager) GetServiceVersion

func (m *Manager) GetServiceVersion(serviceName, version string) (*types.ServiceSpec, error)

GetServiceVersion retrieves a specific version of a service

func (*Manager) ListServices

func (m *Manager) ListServices() ([]*types.CatalogService, error)

ListServices returns a list of all available services

func (*Manager) ListServicesByCategory

func (m *Manager) ListServicesByCategory(category string) ([]*types.CatalogService, error)

ListServicesByCategory returns services filtered by category

func (*Manager) LoadCatalog

func (m *Manager) LoadCatalog() (*types.ServiceCatalog, error)

LoadCatalog loads and parses the catalog from hierarchical structure

func (*Manager) SearchServices

func (m *Manager) SearchServices(query string) ([]*types.CatalogService, error)

SearchServices searches for services by name, description, or tags

func (*Manager) SetCatalogURL

func (m *Manager) SetCatalogURL(url string)

SetCatalogURL sets a custom catalog URL (for testing or custom catalogs)

func (*Manager) ValidateCatalog

func (m *Manager) ValidateCatalog() error

ValidateCatalog validates the catalog structure

type ServiceLinks struct {
	Homepage      string `yaml:"homepage,omitempty"`
	Documentation string `yaml:"documentation,omitempty"`
	Repository    string `yaml:"repository,omitempty"`
}

ServiceLinks represents service links

type ServiceMetadata

type ServiceMetadata struct {
	Name              string        `yaml:"name"`
	Description       string        `yaml:"description"`
	Category          string        `yaml:"category"`
	Icon              string        `yaml:"icon"`
	Tags              []string      `yaml:"tags"`
	Links             *ServiceLinks `yaml:"links,omitempty"`
	AvailableVersions []string      `yaml:"available_versions"`
	LatestVersion     string        `yaml:"latest_version"`
}

ServiceMetadata represents service.yaml structure

type VersionConfig

type VersionConfig struct {
	Version       string                      `yaml:"version"`
	Image         string                      `yaml:"image"`
	Description   string                      `yaml:"description"`
	Port          int                         `yaml:"port"`
	AdminPort     int                         `yaml:"admin_port,omitempty"`
	Protocol      string                      `yaml:"protocol"`
	Ports         []string                    `yaml:"ports,omitempty"` // NEW: Additional port mappings
	Volumes       []string                    `yaml:"volumes,omitempty"`
	Command       []string                    `yaml:"command,omitempty"`
	Environment   map[string]string           `yaml:"environment,omitempty"`
	Healthcheck   *types.Healthcheck          `yaml:"healthcheck,omitempty"`
	Resources     *types.ResourceRequirements `yaml:"resources,omitempty"`
	Configuration *types.ServiceConfiguration `yaml:"configuration,omitempty"`

	// Multi-container support (NEW)
	Containers     []types.ContainerSpec `yaml:"containers,omitempty"`
	InitContainers []types.InitContainer `yaml:"init_containers,omitempty"` // NEW: Init containers

	// Dependencies - support both old and new formats
	Dependencies   []string               `yaml:"dependencies,omitempty"`    // OLD: Simple string list (for backward compatibility)
	DependenciesV2 []types.DependencySpec `yaml:"dependencies_v2,omitempty"` // NEW: Full dependency specs
}

VersionConfig represents version config.yaml structure

Jump to

Keyboard shortcuts

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