Documentation
¶
Overview ¶
Package directory is the in-memory index the marketplace virtual workspace answers from: Providers mirrored from the catalog tier, published APIExports mirrored from every producer workspace. It is read-heavy, written only by the mirroring controllers, and guarded by one mutex — the catalog is small and a browse must never block a sync.
Index ¶
- type Directory
- func (d *Directory) Catalog() []Entry
- func (d *Directory) Counts() (producers, offerings int)
- func (d *Directory) ForgetCluster(cluster string)
- func (d *Directory) Lookup(name string) (Entry, bool)
- func (d *Directory) Ready() bool
- func (d *Directory) RemoveInstructions(key Key)
- func (d *Directory) RemoveOffering(key Key)
- func (d *Directory) RemoveProducer(key Key)
- func (d *Directory) RemoveSchema(key Key)
- func (d *Directory) SetReady()
- func (d *Directory) UpsertInstructions(key Key, sections map[string]string)
- func (d *Directory) UpsertOffering(key Key, o Offering)
- func (d *Directory) UpsertProducer(key Key, p Producer)
- func (d *Directory) UpsertSchema(key Key, s Schema)
- type Entry
- type Key
- type Offering
- type Producer
- type ResourceRef
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
Directory is safe for concurrent use.
func (*Directory) Catalog ¶
Catalog lists every offering whose workspace a Producer record names, sorted by name for stable output. An offering published from a workspace no record names is invisible — publishing into the void is not publishing, and it is also the case an unregistered workspace would use to put itself on the catalog by annotating its own export.
func (*Directory) ForgetCluster ¶
ForgetCluster drops everything mirrored from one logical cluster — a workspace that unbound its export leaves nothing behind.
func (*Directory) RemoveInstructions ¶
func (*Directory) RemoveOffering ¶
func (*Directory) RemoveProducer ¶
func (*Directory) RemoveSchema ¶
func (*Directory) SetReady ¶
func (d *Directory) SetReady()
SetReady marks the initial sync complete; Ready reports it.
func (*Directory) UpsertInstructions ¶
UpsertInstructions records the content of one instructions ConfigMap. Which offerings use it is decided at read time by name, so the two mirrors never have to know about each other.
func (*Directory) UpsertOffering ¶
func (*Directory) UpsertProducer ¶
func (*Directory) UpsertSchema ¶
UpsertSchema records one APIResourceSchema. As with instructions, which offerings use it is decided at read time by name.
type Entry ¶
type Entry struct {
Producer string
Offering string
// WorkspacePath is the canonical path of the producer's workspace —
// what the APIBinding a consumer authors references as
// spec.reference.export.path.
WorkspacePath string
Detail Offering
// Instructions is the referenced ConfigMap's content, or nil if the
// offering names none or it has not been seen.
Instructions map[string]string
// Resources are the offering's resources joined with their schemas;
// one whose schema has not been seen carries no versions.
Resources []marketplacev1alpha1.OfferingResource
}
Entry is one catalog listing: a published export joined with the Producer record that owns its workspace.
type Offering ¶
type Offering struct {
DisplayName string
Description string
Export string
Revision string
Claims []marketplacev1alpha1.OfferingClaim
Ready bool
IdentityHash string
DocsURL string
// InstructionsRef names a ConfigMap in the offering's own cluster; the
// content is mirrored separately and joined at read time, so an edit
// to the instructions never has to re-reconcile the export.
InstructionsRef string
// Resources are the export's spec.resources. Like instructions, the
// schemas they name are mirrored separately and joined at read time.
Resources []ResourceRef
}
Offering is the directory's view of a published APIExport.
There is no Producer field: which producer an offering belongs to is not something the offering records, it is which workspace the export lives in. Catalog resolves it by matching the export's logical cluster against the Producer records, so a producer cannot be misattributed by anything written in the producer's own workspace.
type Producer ¶
type Producer struct {
DisplayName string
Description string
WorkspacePath string
WorkspaceCluster string
Ready bool
}
Producer is the directory's view of a catalog record.
type ResourceRef ¶
ResourceRef is one resource an export serves and the APIResourceSchema, in the export's own cluster, that defines it.
type Schema ¶
type Schema struct {
Kind string
Scope string
Versions []marketplacev1alpha1.OfferingResourceVersion
}
Schema is the directory's view of an APIResourceSchema: what the catalog shows of it.