servicecenter

package
v0.0.0-...-5e0f84c Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExpireTime      = 0
	DefaultRefreshInterval = time.Second * 30
)

constant values for default expiration time, and refresh interval

View Source
const (
	InstanceIDIsExist    = "instanceIdIsExist"
	InstanceIDIsNotExist = "instanceIdIsNotExist"
)

constant values for checking instance ID status

View Source
const (
	// ServiceCenter constant string
	ServiceCenter = "servicecenter"
)

Variables

This section is empty.

Functions

func ToMicroService

func ToMicroService(scs *model.MicroService) *registry.MicroService

ToMicroService assign model micro-service parameters to the registry micro-service

func ToMicroServiceInstance

func ToMicroServiceInstance(ins *model.MicroServiceInstance) *registry.MicroServiceInstance

ToMicroServiceInstance assign model micro-service instance parameters to registry micro-service instance parameters

func ToSCDependency

ToSCDependency assign registry micro-service dependencies to model micro-service dependencies

func ToSCInstance

ToSCInstance assign registry micro-service instance parameters to model micro-service instance parameters

func ToSCService

func ToSCService(cs *registry.MicroService) *model.MicroService

ToSCService assign registry micro-service parameters to the model micro-service

Types

type CacheManager

type CacheManager struct {
	// contains filtered or unexported fields
}

CacheManager cache manager

func (*CacheManager) AutoSync

func (c *CacheManager) AutoSync()

AutoSync automatically syncing with the running instances

func (*CacheManager) MakeIPIndex

func (c *CacheManager) MakeIPIndex() error

MakeIPIndex make ip index

func (*CacheManager) MakeSchemaIndex

func (c *CacheManager) MakeSchemaIndex() error

MakeSchemaIndex make schema index

type Servicecenter

type Servicecenter struct {
	Name string
	// contains filtered or unexported fields
}

Servicecenter to represent the object of service center to call the APIs of service center

func (*Servicecenter) AddDependencies

func (r *Servicecenter) AddDependencies(cDep *registry.MicroServiceDependency) error

AddDependencies : 注册微服务的依赖关系

func (*Servicecenter) AddSchemas

func (r *Servicecenter) AddSchemas(microServiceID, schemaName, schemaInfo string) error

AddSchemas to service center

func (*Servicecenter) AutoSync

func (r *Servicecenter) AutoSync()

AutoSync updating the cache manager

func (*Servicecenter) Close

func (r *Servicecenter) Close() error

Close : Close all websocket connection.

func (*Servicecenter) FindMicroServiceInstances

func (r *Servicecenter) FindMicroServiceInstances(consumerID, appID, microServiceName, version string) ([]*registry.MicroServiceInstance, error)

FindMicroServiceInstances find micro-service instances

func (*Servicecenter) GetAllApplications

func (r *Servicecenter) GetAllApplications() ([]string, error)

GetAllApplications : Get all Applications information.

func (*Servicecenter) GetAllMicroServices

func (r *Servicecenter) GetAllMicroServices() ([]*registry.MicroService, error)

GetAllMicroServices : Get all MicroService information.

func (*Servicecenter) GetDependentMicroServiceInstances

func (r *Servicecenter) GetDependentMicroServiceInstances(appID, consumerMicroServiceName, version string) ([]*model.MicroServiceInstance, error)

GetDependentMicroServiceInstances : 获取指定微服务所依赖的所有实例

func (*Servicecenter) GetMicroService

func (r *Servicecenter) GetMicroService(microServiceID string) (*registry.MicroService, error)

GetMicroService : 根据microServiceID获取对应的微服务信息

func (*Servicecenter) GetMicroServiceID

func (r *Servicecenter) GetMicroServiceID(appID, microServiceName, version string) (string, error)

GetMicroServiceID : 获取指定微服务的MicroServiceID

func (*Servicecenter) GetMicroServiceInstances

func (r *Servicecenter) GetMicroServiceInstances(consumerID, providerID string) ([]*registry.MicroServiceInstance, error)

GetMicroServiceInstances : 获取指定微服务的所有实例

func (*Servicecenter) GetMicroServicesByInterface

func (r *Servicecenter) GetMicroServicesByInterface(interfaceName string) (microService []*registry.MicroService)

GetMicroServicesByInterface get micro-services by interface

func (*Servicecenter) GetSchema

func (r *Servicecenter) GetSchema(microServiceID, schemaName string) ([]byte, error)

GetSchema from service center

func (*Servicecenter) GetSchemaContentByInterface

func (r *Servicecenter) GetSchemaContentByInterface(interfaceName string) (schemas registry.SchemaContent)

GetSchemaContentByInterface get schema content by interface

func (*Servicecenter) GetSchemaContentByServiceName

func (r *Servicecenter) GetSchemaContentByServiceName(svcName, version, appID, env string) (schemas []*registry.SchemaContent)

GetSchemaContentByServiceName get schema content by service name

func (*Servicecenter) Heartbeat

func (r *Servicecenter) Heartbeat(microServiceID, microServiceInstanceID string) (bool, error)

Heartbeat : Keep instance heartbeats.

func (*Servicecenter) RegisterService

func (r *Servicecenter) RegisterService(ms *registry.MicroService) (string, error)

RegisterService : 注册微服务

func (*Servicecenter) RegisterServiceAndInstance

func (r *Servicecenter) RegisterServiceAndInstance(cMicroService *registry.MicroService, cInstance *registry.MicroServiceInstance) (string, string, error)

RegisterServiceAndInstance : 注册微服务

func (*Servicecenter) RegisterServiceInstance

func (r *Servicecenter) RegisterServiceInstance(sid string, cIns *registry.MicroServiceInstance) (string, error)

RegisterServiceInstance : 注册微服务

func (*Servicecenter) String

func (r *Servicecenter) String() string

String returns string

func (*Servicecenter) UnregisterMicroServiceInstance

func (r *Servicecenter) UnregisterMicroServiceInstance(microServiceID, microServiceInstanceID string) error

UnregisterMicroServiceInstance : 去注册微服务实例

func (*Servicecenter) UpdateMicroServiceInstanceProperties

func (r *Servicecenter) UpdateMicroServiceInstanceProperties(microServiceID, microServiceInstanceID string, properties map[string]string) error

UpdateMicroServiceInstanceProperties : 更新微服务实例properties信息

func (*Servicecenter) UpdateMicroServiceInstanceStatus

func (r *Servicecenter) UpdateMicroServiceInstanceStatus(microServiceID, microServiceInstanceID, status string) error

UpdateMicroServiceInstanceStatus : 更新微服务实例状态信息

func (*Servicecenter) UpdateMicroServiceProperties

func (r *Servicecenter) UpdateMicroServiceProperties(microServiceID string, properties map[string]string) error

UpdateMicroServiceProperties 更新微服务properties信息

func (*Servicecenter) WatchMicroService

func (r *Servicecenter) WatchMicroService(selfMicroServiceID string, callback func(*model.MicroServiceInstanceChangedEvent))

WatchMicroService : 支持用户自调用主动监听实例变化功能

Jump to

Keyboard shortcuts

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