Documentation ¶
Index ¶
- Constants
- func InitConfigs()
- func NewRepository() mgr.Instance
- type AdaptorsIndexer
- type Aggregator
- type AggregatorIndexer
- type Cache
- func (c Cache) ForEach(iter func(k string, v *discovery.KeyValue) (next bool))
- func (c Cache) Get(k string) (kv *discovery.KeyValue)
- func (c Cache) GetAll(arr *[]*discovery.KeyValue) (s int)
- func (c Cache) GetPrefix(prefix string, arr *[]*discovery.KeyValue) (s int)
- func (c Cache) Name() string
- func (c Cache) Size() (s int)
- type ConflictChecker
- type Repository
Constants ¶
const ( Aggregate = "aggregate" AggregateModes = "k8s,servicecenter" )
Variables ¶
This section is empty.
Functions ¶
func InitConfigs ¶
func InitConfigs()
func NewRepository ¶
Types ¶
type AdaptorsIndexer ¶
AdaptorsIndexer implements discovery.Indexer. AdaptorsIndexer is an aggregator of multi Indexers, and it aggregates all the Indexers' data as it's result.
func NewAdaptorsIndexer ¶
func NewAdaptorsIndexer(as []discovery.Adaptor) *AdaptorsIndexer
func (*AdaptorsIndexer) Creditable ¶
func (i *AdaptorsIndexer) Creditable() bool
Creditable implements discovery.Indexer.Creditable. AdaptorsIndexer's search result's are not creditable as it ignores the errors. In other words, AdaptorsIndexer makes the best efforts to search data, but it does not ensure the correctness.
func (*AdaptorsIndexer) Search ¶
func (i *AdaptorsIndexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (*discovery.Response, error)
Search implements discovery.Indexer.Search. AdaptorsIndexer ignores the errors during search to ensure availability, so it always searches successfully, no matter how many Adaptors are abnormal. But at the cost of that, AdaptorsIndexer doesn't guarantee the correctness of the search results.
type Aggregator ¶
type Aggregator struct { // Indexer searches data from all the adapters discovery.Indexer Type discovery.Type Adaptors []discovery.Adaptor }
Aggregator implements discovery.Adaptor. Aggregator is an aggregator of multi Adaptors, and it aggregates all the Adaptors' data as it's result.
func NewAggregator ¶
func NewAggregator(t discovery.Type, cfg *discovery.Config) *Aggregator
func (*Aggregator) Cache ¶
func (as *Aggregator) Cache() discovery.CacheReader
Cache gets all the adapters' cache
func (*Aggregator) Ready ¶
func (as *Aggregator) Ready() <-chan struct{}
func (*Aggregator) Run ¶
func (as *Aggregator) Run()
func (*Aggregator) Stop ¶
func (as *Aggregator) Stop()
type AggregatorIndexer ¶
type AggregatorIndexer struct { // CacheIndexer searches data from all the adaptors's cache. *discovery.CacheIndexer // AdaptorsIndexer searches data from all the adaptors. AdaptorsIndexer discovery.Indexer // LocalIndexer data from registry indexer. LocalIndexer discovery.Indexer }
AggregatorIndexer implements discovery.Indexer. AggregatorIndexer consists of multi Indexers and it decides which Indexer to use based on it's mechanism.
func NewAggregatorIndexer ¶
func NewAggregatorIndexer(as *Aggregator) *AggregatorIndexer
func (*AggregatorIndexer) Creditable ¶
func (i *AggregatorIndexer) Creditable() bool
Creditable implements discovery.Indexer.Creditable.
func (*AggregatorIndexer) Search ¶
func (i *AggregatorIndexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (resp *discovery.Response, err error)
Search implements discovery.Indexer.Search.
type Cache ¶
type Cache []discovery.CacheReader
Cache implements CacheReader. Cache is a multi-CacheReader, it reads cache from all CacheReaders.
type ConflictChecker ¶
type ConflictChecker struct { Cache discovery.CacheReader ConflictHandleFunc func(origin, conflict *discovery.KeyValue) }
func NewConflictChecker ¶
func NewConflictChecker(cache discovery.CacheReader, f func(origin, conflict *discovery.KeyValue)) *ConflictChecker
func (*ConflictChecker) Check ¶
func (c *ConflictChecker) Check()
func (*ConflictChecker) Run ¶
func (c *ConflictChecker) Run(ctx context.Context)