Documentation
¶
Overview ¶
Package manager implements a schema manager for use in Crossplane projects.
Index ¶
- type Manager
- type Source
- func NewFSSource(id string, fs afero.Fs) Source
- func NewGitSource(dep v1alpha1.Dependency, cloner git.Cloner, authProvider git.AuthProvider) Source
- func NewHTTPSource(dep v1alpha1.Dependency) Source
- func NewK8sSource(dep v1alpha1.Dependency) Source
- func NewXpkgSource(id, version string, crdFS afero.Fs) Source
- type SourceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a schema manager. It manages a directory of schemas, generating new schemas only when necessary.
func (*Manager) Add ¶
Add ensures schemas for resources in the given source are present in the managed directory.
type Source ¶
type Source interface {
// ID returns a unique identifier for this source.
ID() string
// Version returns a revision identifier for this source.
Version(ctx context.Context) (string, error)
// Resources returns a filesystem containing resources for which schemas
// need to be generated.
Resources(ctx context.Context) (afero.Fs, error)
// Type returns the type of source.
Type() SourceType
}
Source is a source of resources for which schemas can be generated.
func NewFSSource ¶
NewFSSource returns a new filesystem-backed resource source. The id should be a stable, location-independent identifier (e.g. a project-relative path) since it is persisted in the schema manager's lockfile.
func NewGitSource ¶
func NewGitSource(dep v1alpha1.Dependency, cloner git.Cloner, authProvider git.AuthProvider) Source
NewGitSource returns a new git-backed resource source.
func NewHTTPSource ¶
func NewHTTPSource(dep v1alpha1.Dependency) Source
NewHTTPSource returns a new HTTP-backed resource source.
func NewK8sSource ¶
func NewK8sSource(dep v1alpha1.Dependency) Source
NewK8sSource returns a source for Kubernetes built-in APIs.
type SourceType ¶
type SourceType string
SourceType represents the type of source.
const ( // SourceTypeCRD indicates a source containing CRDs/XRDs. SourceTypeCRD SourceType = "crd" // SourceTypeOpenAPI indicates a source containing OpenAPI specifications. SourceTypeOpenAPI SourceType = "openapi" )