service

package
v3.0.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertURLArrToIntfArr

func ConvertURLArrToIntfArr(urls []*common.URL) []interface{}

Types

type BaseMetadataService

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

BaseMetadataService is used for the event logic for struct who will implement interface MetadataService

func NewBaseMetadataService

func NewBaseMetadataService(serviceName string) BaseMetadataService

func (*BaseMetadataService) MethodMapper

func (mts *BaseMetadataService) MethodMapper() map[string]string

func (*BaseMetadataService) Reference

func (mts *BaseMetadataService) Reference() string

Reference will return the reference id of metadata service

func (*BaseMetadataService) ServiceName

func (mts *BaseMetadataService) ServiceName() (string, error)

ServiceName can get the service's name in meta service , which is application name

type BaseMetadataServiceProxyFactory

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

func (*BaseMetadataServiceProxyFactory) GetProxy

type MetadataService

type MetadataService interface {
	common.ReferencedRPCService
	// ServiceName will get the service's name in meta service , which is application name
	ServiceName() (string, error)
	// ExportURL will store the exported url in metadata
	ExportURL(url *common.URL) (bool, error)
	// UnexportURL will delete the exported url in metadata
	UnexportURL(url *common.URL) error
	// SubscribeURL will store the subscribed url in metadata
	SubscribeURL(url *common.URL) (bool, error)
	// UnsubscribeURL will delete the subscribed url in metadata
	UnsubscribeURL(url *common.URL) error
	// PublishServiceDefinition will generate the target url's code info
	PublishServiceDefinition(url *common.URL) error
	// GetExportedURLs will get the target exported url in metadata
	// the url should be unique
	// due to dubbo-go only support return array []interface{} in RPCService, so we should declare the return type as []interface{}
	// actually, it's []String
	GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]*common.URL, error)
	// MethodMapper for rename dubbo method name
	MethodMapper() map[string]string
	// GetSubscribedURLs will get the target subscribed url in metadata the url should be unique
	GetSubscribedURLs() ([]*common.URL, error)
	// GetServiceDefinition will get the target service info store in metadata
	GetServiceDefinition(interfaceName string, group string, version string) (string, error)
	// GetServiceDefinitionByServiceKey will get the target service info store in metadata by service key
	GetServiceDefinitionByServiceKey(serviceKey string) (string, error)
	// RefreshMetadata will refresh the metadata
	RefreshMetadata(exportedRevision string, subscribedRevision string) (bool, error)
	// Version will return the metadata service version
	Version() (string, error)
	// GetMetadataInfo will return metadata info
	GetMetadataInfo(revision string) (*common.MetadataInfo, error)
	// GetExportedServiceURLs will return exported service urls
	GetExportedServiceURLs() ([]*common.URL, error)
	// GetMetadataServiceURL will return the url of metadata service
	GetMetadataServiceURL() (*common.URL, error)
	// SetMetadataServiceURL will save the url of metadata service
	SetMetadataServiceURL(*common.URL) error
}

MetadataService is used to define meta data related behaviors usually the implementation should be singleton

type MetadataServiceProxyCreator

type MetadataServiceProxyCreator func(ins registry.ServiceInstance) MetadataService

type MetadataServiceProxyFactory

type MetadataServiceProxyFactory interface {
	GetProxy(ins registry.ServiceInstance) MetadataService
}

type RemoteMetadataService

type RemoteMetadataService interface {
	// PublishMetadata publish the medata info of service from report
	PublishMetadata(service string)
	// GetMetadata get the medata info of service from report
	GetMetadata(instance registry.ServiceInstance) (*common.MetadataInfo, error)
	// PublishServiceDefinition will call remote metadata's StoreProviderMetadata to store url info and service definition
	PublishServiceDefinition(url *common.URL) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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