Documentation
¶
Overview ¶
Package registry handles fetching CUE modules from the CUE Central Registry.
Index ¶
- Constants
- func EffectiveIndexPath(configured string) string
- type Client
- func (c *Client) Fetch(ctx context.Context, modulePath string) (FetchResult, error)
- func (c *Client) FetchIndex(ctx context.Context, indexPath string) (*Index, string, error)
- func (c *Client) ModuleVersions(ctx context.Context, modulePath string) ([]string, error)
- func (c *Client) Registry() modconfig.Registry
- func (c *Client) ResolveLatestVersion(ctx context.Context, modulePath string) (string, error)
- type FetchResult
- type Index
- type IndexEntry
Constants ¶
const IndexModulePath = "github.com/start-cli/library/index@v1"
IndexModulePath is the CUE module path for the start library index. Uses major version; resolved to latest canonical version at runtime.
const SchemaModulePath = "github.com/start-cli/library/schemas@v1"
SchemaModulePath is the CUE module path for the start library schemas. Used by doctor to validate configs against schema constraints.
Variables ¶
This section is empty.
Functions ¶
func EffectiveIndexPath ¶
EffectiveIndexPath returns configured if non-empty, otherwise IndexModulePath.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches CUE modules from the registry with retry logic.
func NewClient ¶
NewClient creates a registry client using CUE's standard configuration. It respects CUE_REGISTRY environment variable and cue login authentication.
func (*Client) Fetch ¶
Fetch downloads a module from the registry with retry logic. The module path should include version, e.g., "github.com/user/repo/path@v0".
func (*Client) FetchIndex ¶
FetchIndex fetches and parses the index from the registry. indexPath is the CUE module path to use; pass empty string to use IndexModulePath. Returns the parsed index, the resolved canonical version string, and any error.
func (*Client) ModuleVersions ¶
ModuleVersions returns available versions for a module path.
type FetchResult ¶
type FetchResult struct {
// SourceDir is the filesystem path to the fetched module.
SourceDir string
}
FetchResult contains the result of fetching a module.
type Index ¶
type Index struct {
Agents map[string]IndexEntry `json:"agents,omitempty"`
Roles map[string]IndexEntry `json:"roles,omitempty"`
Contexts map[string]IndexEntry `json:"contexts,omitempty"`
Tasks map[string]IndexEntry `json:"tasks,omitempty"`
}
Index represents the full library discovery index.