inmemory

package
v3.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInMemoryMetadataService

func GetInMemoryMetadataService() (service.MetadataService, error)

NewMetadataService: initiate a metadata service it should be singleton

func GetInMemoryMetadataServiceProxyFactory

func GetInMemoryMetadataServiceProxyFactory() service.MetadataServiceProxyFactory

Types

type MetadataService

type MetadataService struct {
	service.BaseMetadataService
	// contains filtered or unexported fields
}

MetadataService is store and query the metadata info in memory when each service registry

func (*MetadataService) ExportURL

func (mts *MetadataService) ExportURL(url *common.URL) (bool, error)

ExportURL can store the in memory

func (*MetadataService) GetExportedServiceURLs

func (mts *MetadataService) GetExportedServiceURLs() []*common.URL

GetExportedServiceURLs get exported service urls

func (*MetadataService) GetExportedURLs

func (mts *MetadataService) GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]*common.URL, error)

GetExportedURLs get all exported urls

func (*MetadataService) GetMetadataInfo

func (mts *MetadataService) GetMetadataInfo(revision string) (*common.MetadataInfo, error)

GetMetadataInfo can get metadata in memory

func (*MetadataService) GetMetadataServiceURL

func (mts *MetadataService) GetMetadataServiceURL() *common.URL

GetMetadataServiceURL get url of MetadataService

func (*MetadataService) GetServiceDefinition

func (mts *MetadataService) GetServiceDefinition(interfaceName string, group string, version string) (string, error)

GetServiceDefinition can get service definition by interfaceName, group and version

func (*MetadataService) GetServiceDefinitionByServiceKey

func (mts *MetadataService) GetServiceDefinitionByServiceKey(serviceKey string) (string, error)

GetServiceDefinition can get service definition by serviceKey

func (*MetadataService) GetSubscribedURLs

func (mts *MetadataService) GetSubscribedURLs() ([]*common.URL, error)

GetSubscribedURLs get all subscribedUrl

func (*MetadataService) PublishServiceDefinition

func (mts *MetadataService) PublishServiceDefinition(url *common.URL) error

PublishServiceDefinition: publish url's service metadata info, and write into memory

func (*MetadataService) RefreshMetadata

func (mts *MetadataService) RefreshMetadata(string, string) (bool, error)

RefreshMetadata will always return true because it will be implement by remote service

func (*MetadataService) SetMetadataServiceURL

func (mts *MetadataService) SetMetadataServiceURL(url *common.URL)

GetMetadataServiceURL save url of MetadataService

func (*MetadataService) SubscribeURL

func (mts *MetadataService) SubscribeURL(url *common.URL) (bool, error)

SubscribeURL can store the in memory

func (*MetadataService) UnexportURL

func (mts *MetadataService) UnexportURL(url *common.URL) error

UnexportURL can remove the url store in memory

func (*MetadataService) UnsubscribeURL

func (mts *MetadataService) UnsubscribeURL(url *common.URL) error

UnsubscribeURL can remove the url store in memory

func (*MetadataService) Version

func (mts *MetadataService) Version() (string, error)

Version will return the version of metadata service

type MetadataServiceProxy

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

actually it's RPC stub this will only be used by client-side if the metadata service is "local" metadata service in server side, which means that metadata service is RPC service too. so in client-side, if we want to get the metadata information, we must call metadata service this is the stub, or proxy for now, only GetMetadataInfo need to be implemented TODO use ProxyFactory to create proxy

func (*MetadataServiceProxy) ExportURL

func (m *MetadataServiceProxy) ExportURL(url *common.URL) (bool, error)

nolint

func (*MetadataServiceProxy) GetExportedServiceURLs

func (m *MetadataServiceProxy) GetExportedServiceURLs() []*common.URL

nolint

func (*MetadataServiceProxy) GetExportedURLs

func (m *MetadataServiceProxy) GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]*common.URL, error)

nolint

func (*MetadataServiceProxy) GetMetadataInfo

func (m *MetadataServiceProxy) GetMetadataInfo(revision string) (*common.MetadataInfo, error)

nolint

func (*MetadataServiceProxy) GetMetadataServiceURL

func (m *MetadataServiceProxy) GetMetadataServiceURL() *common.URL

nolint

func (*MetadataServiceProxy) GetServiceDefinition

func (m *MetadataServiceProxy) GetServiceDefinition(interfaceName string, group string, version string) (string, error)

nolint

func (*MetadataServiceProxy) GetServiceDefinitionByServiceKey

func (m *MetadataServiceProxy) GetServiceDefinitionByServiceKey(serviceKey string) (string, error)

nolint

func (*MetadataServiceProxy) GetSubscribedURLs

func (m *MetadataServiceProxy) GetSubscribedURLs() ([]*common.URL, error)

nolint

func (*MetadataServiceProxy) MethodMapper

func (m *MetadataServiceProxy) MethodMapper() map[string]string

nolint

func (*MetadataServiceProxy) PublishServiceDefinition

func (m *MetadataServiceProxy) PublishServiceDefinition(url *common.URL) error

nolint

func (*MetadataServiceProxy) Reference

func (m *MetadataServiceProxy) Reference() string

nolint

func (*MetadataServiceProxy) RefreshMetadata

func (m *MetadataServiceProxy) RefreshMetadata(exportedRevision string, subscribedRevision string) (bool, error)

nolint

func (*MetadataServiceProxy) ServiceName

func (m *MetadataServiceProxy) ServiceName() (string, error)

nolint

func (*MetadataServiceProxy) SetMetadataServiceURL

func (m *MetadataServiceProxy) SetMetadataServiceURL(*common.URL)

nolint

func (*MetadataServiceProxy) SubscribeURL

func (m *MetadataServiceProxy) SubscribeURL(url *common.URL) (bool, error)

nolint

func (*MetadataServiceProxy) UnexportURL

func (m *MetadataServiceProxy) UnexportURL(url *common.URL) error

nolint

func (*MetadataServiceProxy) UnsubscribeURL

func (m *MetadataServiceProxy) UnsubscribeURL(url *common.URL) error

nolint

func (*MetadataServiceProxy) Version

func (m *MetadataServiceProxy) Version() (string, error)

nolint

Jump to

Keyboard shortcuts

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