inmemory

package
v1.5.9-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 16 Imported by: 18

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 NewMetadataService

func NewMetadataService() (service.MetadataService, error)

NewMetadataService: initiate a metadata service it should be singleton

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) GetExportedURLs

func (mts *MetadataService) GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]interface{}, error)

GetExportedURLs get all exported urls

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) 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 GetExportedURLs need to be implemented

func (*MetadataServiceProxy) ExportURL

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

func (*MetadataServiceProxy) GetExportedURLs

func (m *MetadataServiceProxy) GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]interface{}, error)

func (*MetadataServiceProxy) GetServiceDefinition

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

func (*MetadataServiceProxy) GetServiceDefinitionByServiceKey

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

func (*MetadataServiceProxy) GetSubscribedURLs

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

func (*MetadataServiceProxy) MethodMapper

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

func (*MetadataServiceProxy) PublishServiceDefinition

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

func (*MetadataServiceProxy) Reference

func (m *MetadataServiceProxy) Reference() string

func (*MetadataServiceProxy) RefreshMetadata

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

func (*MetadataServiceProxy) ServiceName

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

func (*MetadataServiceProxy) SubscribeURL

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

func (*MetadataServiceProxy) UnexportURL

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

func (*MetadataServiceProxy) UnsubscribeURL

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

func (*MetadataServiceProxy) Version

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

Jump to

Keyboard shortcuts

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