Documentation
¶
Overview ¶
Package dependency manages schema generation for Crossplane project dependencies.
Index ¶
- func CleanPackages(root string, fs afero.Fs) error
- func DefaultCacheDir() string
- func GetSourceDescription(dep v1alpha1.Dependency) string
- type Manager
- func (m *Manager) AddAll(ctx context.Context, ch async.EventChannel) error
- func (m *Manager) AddDependency(ctx context.Context, dep *v1alpha1.Dependency) error
- func (m *Manager) AddPackage(ctx context.Context, ref string, refresh bool) (*schema.GroupVersionKind, error)
- func (m *Manager) Clean() error
- func (m *Manager) RefreshAll(ctx context.Context, ch async.EventChannel) error
- func (m *Manager) ResolveRef(ref string) (name.Reference, error)
- type ManagerOption
- func WithGitAuthProvider(p git.AuthProvider) ManagerOption
- func WithProjectFile(path string) ManagerOption
- func WithResolver(r *clixpkg.Resolver) ManagerOption
- func WithSchemaFS(fs afero.Fs) ManagerOption
- func WithSchemaGenerators(gs []generator.Interface) ManagerOption
- func WithSchemaRunner(r runner.SchemaRunner) ManagerOption
- func WithXpkgClient(c runtimexpkg.Client) ManagerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanPackages ¶
CleanPackages removes the per-user xpkg cache directory at root.
func DefaultCacheDir ¶
func DefaultCacheDir() string
DefaultCacheDir returns the default per-user xpkg cache directory.
func GetSourceDescription ¶
func GetSourceDescription(dep v1alpha1.Dependency) string
GetSourceDescription returns a human-readable description of a dependency.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages dependencies for a Crossplane project, including fetching packages, extracting CRDs, and generating schemas.
func NewManager ¶
NewManager returns an initialized dependency manager.
func (*Manager) AddAll ¶
AddAll adds all dependencies configured in the project. If ch is non-nil, events will be sent for each dependency as it is processed.
func (*Manager) AddDependency ¶
AddDependency adds a dependency, generates schemas for it, and persists the dependency to the project file.
func (*Manager) AddPackage ¶
func (m *Manager) AddPackage(ctx context.Context, ref string, refresh bool) (*schema.GroupVersionKind, error)
AddPackage adds a package to the dependency manager. If refresh is set, the package's ref will be re-resolved regardless of whether it is cached.
func (*Manager) RefreshAll ¶
RefreshAll re-resolves every dependency's version constraint against the registry. Used by `dependency update-cache`.
type ManagerOption ¶
type ManagerOption func(*managerOptions)
ManagerOption configures the dependency manager.
func WithGitAuthProvider ¶
func WithGitAuthProvider(p git.AuthProvider) ManagerOption
WithGitAuthProvider sets the auth provider for git operations.
func WithProjectFile ¶
func WithProjectFile(path string) ManagerOption
WithProjectFile sets the path to the project file.
func WithResolver ¶
func WithResolver(r *clixpkg.Resolver) ManagerOption
WithResolver sets the package reference resolver used to translate semver constraints into concrete tags before calling Client.Get.
func WithSchemaFS ¶
func WithSchemaFS(fs afero.Fs) ManagerOption
WithSchemaFS sets the filesystem to use for schemas.
func WithSchemaGenerators ¶
func WithSchemaGenerators(gs []generator.Interface) ManagerOption
WithSchemaGenerators sets the schema generators to call.
func WithSchemaRunner ¶
func WithSchemaRunner(r runner.SchemaRunner) ManagerOption
WithSchemaRunner sets the runner to use when generating schemas.
func WithXpkgClient ¶
func WithXpkgClient(c runtimexpkg.Client) ManagerOption
WithXpkgClient sets the runtime xpkg.Client used to fetch and parse xpkg dependencies.