Documentation
¶
Overview ¶
Package schema implements a framework to sync schema info from the metadata repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶ added in v0.8.0
type DB interface {
io.Closer
UpdateOptions(opts *commonv1.ResourceOpts)
}
DB is the interface of a tsdb.
type IndexListener ¶ added in v0.8.0
type IndexListener interface {
OnIndexUpdate(index []*databasev1.IndexRule)
}
IndexListener listens to the index update.
type MetadataEvent ¶
type MetadataEvent struct {
Metadata ResourceSchema
Typ EventType
Kind EventKind
}
MetadataEvent is the syncing message between metadata repo and this framework.
type Metrics ¶ added in v0.7.0
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is a collection of metrics.
func NewMetrics ¶ added in v0.7.0
func NewMetrics(factory *observability.Factory) *Metrics
NewMetrics creates a new Metrics.
type Repository ¶
type Repository interface {
Watcher()
Init(schema.Kind) ([]string, []int64)
SendMetadataEvent(MetadataEvent)
LoadGroup(name string) (Group, bool)
LoadAllGroups() []Group
LoadResource(metadata *commonv1.Metadata) (Resource, bool)
Close()
StopCh() <-chan struct{}
}
Repository is the collection of several hierarchies groups by a "Group".
func NewPortableRepository ¶ added in v0.5.0
func NewPortableRepository( metadata metadata.Repo, l *logger.Logger, supplier ResourceSchemaSupplier, metrics *Metrics, ) Repository
NewPortableRepository return a new Repository without tsdb.
func NewRepository ¶
func NewRepository( metadata metadata.Repo, l *logger.Logger, resourceSupplier ResourceSupplier, metrics *Metrics, ) Repository
NewRepository return a new Repository.
type Resource ¶
type Resource interface {
Schema() ResourceSchema
Delegated() IndexListener
}
Resource allows access metadata from a local cache.
type ResourceSchema ¶
ResourceSchema allows get the metadata.
type ResourceSchemaSupplier ¶ added in v0.5.0
type ResourceSchemaSupplier interface {
ResourceSchema(metadata *commonv1.Metadata) (ResourceSchema, error)
OpenResource(spec Resource) (IndexListener, error)
}
ResourceSchemaSupplier allows get a ResourceSchema from the metadata.
type ResourceSupplier ¶
type ResourceSupplier interface {
ResourceSchemaSupplier
OpenDB(groupSchema *commonv1.Group) (DB, error)
}
ResourceSupplier allows open a resource and its embedded tsdb.