servicecenter

package
v1.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCacher

func BuildCacher(t discovery.Type, cfg *discovery.Config, cache discovery.Cache) discovery.Cacher

func InitConfigs

func InitConfigs()

func NewRepository

func NewRepository() mgr.Instance

Types

type Adaptor

type Adaptor struct {
	discovery.Cacher
	discovery.Indexer
}

Adaptor implements discovery.Adaptor. Adaptor does service discovery with other service-centers as it's registry.

func NewServiceCenterAdaptor

func NewServiceCenterAdaptor(t discovery.Type, cfg *discovery.Config) *Adaptor

func (*Adaptor) Ready

func (se *Adaptor) Ready() <-chan struct{}

func (*Adaptor) Run

func (se *Adaptor) Run()

func (*Adaptor) Stop

func (se *Adaptor) Stop()

type Cacher

type Cacher struct {
	*discovery.CommonCacher
}

func NewServiceCenterCacher

func NewServiceCenterCacher(cfg *discovery.Config, cache discovery.Cache) *Cacher

func (*Cacher) Ready

func (c *Cacher) Ready() <-chan struct{}

type ClusterIndexer

type ClusterIndexer struct {
	*discovery.CacheIndexer
	Client *SCClientAggregate
	Type   discovery.Type
}

ClusterIndexer implements discovery.Indexer. ClusterIndexer searches data from cache(firstly) and other service-centers(secondly).

func NewClusterIndexer

func NewClusterIndexer(t discovery.Type, cache discovery.Cache) *ClusterIndexer

func (*ClusterIndexer) Creditable

func (i *ClusterIndexer) Creditable() bool

Creditable implements discovery.Indexer.Creditable. ClusterIndexer's search result's are not creditable as SCClientAggregate ignores sc clients' errors.

func (*ClusterIndexer) Search

func (i *ClusterIndexer) Search(ctx context.Context, opts ...registry.PluginOpOption) (resp *discovery.Response, err error)

type Repository

type Repository struct {
}

func (*Repository) New

type SCClientAggregate

type SCClientAggregate []*client2.Client

func GetOrCreateSCClient

func GetOrCreateSCClient() *SCClientAggregate

func (*SCClientAggregate) GetInstanceByInstanceID

func (c *SCClientAggregate) GetInstanceByInstanceID(ctx context.Context, domain, project, providerID, instanceID, consumerID string) (*discovery.Response, *scerr.Error)

func (*SCClientAggregate) GetInstancesByServiceID

func (c *SCClientAggregate) GetInstancesByServiceID(ctx context.Context, domain, project, providerID, consumerID string) (*discovery.Response, *scerr.Error)

func (*SCClientAggregate) GetScCache

func (c *SCClientAggregate) GetScCache(ctx context.Context) (*model.Cache, map[string]error)

func (*SCClientAggregate) GetSchemaBySchemaID

func (c *SCClientAggregate) GetSchemaBySchemaID(ctx context.Context, domainProject, serviceID, schemaID string) (*discovery.Response, *scerr.Error)

func (*SCClientAggregate) GetSchemasByServiceID

func (c *SCClientAggregate) GetSchemasByServiceID(ctx context.Context, domainProject, serviceID string) (*discovery.Response, *scerr.Error)

type Syncer

type Syncer struct {
	Client *SCClientAggregate
	// contains filtered or unexported fields
}

func GetOrCreateSyncer

func GetOrCreateSyncer() *Syncer

func (*Syncer) AddCacher

func (c *Syncer) AddCacher(t discovery.Type, cacher *Cacher)

unsafe

func (*Syncer) Initialize

func (c *Syncer) Initialize()

func (*Syncer) Run

func (c *Syncer) Run()

func (*Syncer) Sync

func (c *Syncer) Sync(ctx context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL