dubbo.apache.org/dubbo-go/v3@v3.1.1/metadata/report/report.go (about)

     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  See the NOTICE file distributed with
     4   * this work for additional information regarding copyright ownership.
     5   * The ASF licenses this file to You under the Apache License, Version 2.0
     6   * (the "License"); you may not use this file except in compliance with
     7   * the License.  You may obtain a copy of the License at
     8   *
     9   *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17  
    18  package report
    19  
    20  import (
    21  	gxset "github.com/dubbogo/gost/container/set"
    22  )
    23  
    24  import (
    25  	"dubbo.apache.org/dubbo-go/v3/common"
    26  	"dubbo.apache.org/dubbo-go/v3/metadata/identifier"
    27  	"dubbo.apache.org/dubbo-go/v3/registry"
    28  )
    29  
    30  // MetadataReport is an interface of remote metadata report.
    31  type MetadataReport interface {
    32  	// StoreProviderMetadata stores the metadata.
    33  	// Metadata includes the basic info of the server,
    34  	// provider info, and other user custom info.
    35  	StoreProviderMetadata(*identifier.MetadataIdentifier, string) error
    36  
    37  	// StoreConsumerMetadata stores the metadata.
    38  	// Metadata includes the basic info of the server,
    39  	// consumer info, and other user custom info.
    40  	StoreConsumerMetadata(*identifier.MetadataIdentifier, string) error
    41  
    42  	// SaveServiceMetadata saves the metadata.
    43  	// Metadata includes the basic info of the server,
    44  	// service info, and other user custom info.
    45  	SaveServiceMetadata(*identifier.ServiceMetadataIdentifier, *common.URL) error
    46  
    47  	// RemoveServiceMetadata removes the metadata.
    48  	RemoveServiceMetadata(*identifier.ServiceMetadataIdentifier) error
    49  
    50  	// GetExportedURLs gets the urls.
    51  	// If not found, an empty list will be returned.
    52  	GetExportedURLs(*identifier.ServiceMetadataIdentifier) ([]string, error)
    53  
    54  	// SaveSubscribedData saves the urls.
    55  	// If not found, an empty str will be returned.
    56  	SaveSubscribedData(*identifier.SubscriberMetadataIdentifier, string) error
    57  
    58  	// GetSubscribedURLs gets the urls.
    59  	// If not found, an empty list will be returned.
    60  	GetSubscribedURLs(*identifier.SubscriberMetadataIdentifier) ([]string, error)
    61  
    62  	// GetServiceDefinition gets the service definition.
    63  	GetServiceDefinition(*identifier.MetadataIdentifier) (string, error)
    64  
    65  	// GetAppMetadata get metadata info from report
    66  	GetAppMetadata(*identifier.SubscriberMetadataIdentifier) (*common.MetadataInfo, error)
    67  
    68  	// PublishAppMetadata publish metadata info to reportss
    69  	PublishAppMetadata(*identifier.SubscriberMetadataIdentifier, *common.MetadataInfo) error
    70  
    71  	// RegisterServiceAppMapping map the specified Dubbo service interface to current Dubbo app name
    72  	RegisterServiceAppMapping(string, string, string) error
    73  
    74  	// GetServiceAppMapping get the app names from the specified Dubbo service interface
    75  	GetServiceAppMapping(string, string, registry.MappingListener) (*gxset.HashSet, error)
    76  
    77  	// RemoveServiceAppMappingListener remove the serviceMapping listener by key and group
    78  	RemoveServiceAppMappingListener(string, string) error
    79  
    80  	GetConfigKeysByGroup(group string) (*gxset.HashSet, error)
    81  }