Documentation
¶
Index ¶
- Constants
- func CopyFile(src, dst string) error
- type CatalogMetadata
- type HierarchicalLoader
- type Manager
- func (m *Manager) CatalogExists() bool
- func (m *Manager) FetchCatalog() error
- func (m *Manager) GetCatalogDir() string
- func (m *Manager) GetCatalogPath() string
- func (m *Manager) GetCatalogVersion() (string, error)
- func (m *Manager) GetService(serviceName string) (*types.CatalogService, error)
- func (m *Manager) GetServiceVersion(serviceName, version string) (*types.ServiceSpec, error)
- func (m *Manager) ListServices() ([]*types.CatalogService, error)
- func (m *Manager) ListServicesByCategory(category string) ([]*types.CatalogService, error)
- func (m *Manager) LoadCatalog() (*types.ServiceCatalog, error)
- func (m *Manager) SearchServices(query string) ([]*types.CatalogService, error)
- func (m *Manager) SetCatalogURL(url string)
- func (m *Manager) ValidateCatalog() error
- type ServiceLinks
- type ServiceMetadata
- type VersionConfig
Constants ¶
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 ¶
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 ¶
func (l *HierarchicalLoader) Load() (*types.ServiceCatalog, error)
Load loads the complete catalog from hierarchical structure
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles catalog operations
func NewManager ¶
NewManager creates a new catalog manager
func (*Manager) CatalogExists ¶
CatalogExists checks if the catalog file exists
func (*Manager) FetchCatalog ¶
FetchCatalog downloads and extracts the hierarchical catalog
func (*Manager) GetCatalogDir ¶
GetCatalogDir returns the catalog directory path
func (*Manager) GetCatalogPath ¶
GetCatalogPath returns the path to the local catalog file
func (*Manager) GetCatalogVersion ¶
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 ¶
SetCatalogURL sets a custom catalog URL (for testing or custom catalogs)
func (*Manager) ValidateCatalog ¶
ValidateCatalog validates the catalog structure
type ServiceLinks ¶
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