diff --git a/metadata/identifier/base_metadata_identifier.go b/metadata/identifier/base_metadata_identifier.go index a314671055be523844fd7d8f9589b8b6031632bc..963c3d1a56f8173c7727e999805303554e002d84 100644 --- a/metadata/identifier/base_metadata_identifier.go +++ b/metadata/identifier/base_metadata_identifier.go @@ -37,7 +37,6 @@ type BaseServiceMetadataIdentifier struct { side string } -// joinParams... func joinParams(joinChar string, params []string) string { var joinedStr string for _, param := range params { @@ -47,7 +46,7 @@ func joinParams(joinChar string, params []string) string { return joinedStr } -// getIdentifierKey... +// getIdentifierKey gets metadata identifier key by @params func (mdi *BaseServiceMetadataIdentifier) getIdentifierKey(params ...string) string { return mdi.serviceInterface + constant.KEY_SEPARATOR + mdi.version + @@ -56,7 +55,7 @@ func (mdi *BaseServiceMetadataIdentifier) getIdentifierKey(params ...string) str joinParams(constant.KEY_SEPARATOR, params) } -// getFilePathKey... +// getFilePathKey gets metadata file path key by @params func (mdi *BaseServiceMetadataIdentifier) getFilePathKey(params ...string) string { path := serviceToPath(mdi.serviceInterface) @@ -69,7 +68,6 @@ func (mdi *BaseServiceMetadataIdentifier) getFilePathKey(params ...string) strin } -// serviceToPath... func serviceToPath(serviceInterface string) string { if serviceInterface == constant.ANY_VALUE { return "" @@ -83,7 +81,6 @@ func serviceToPath(serviceInterface string) string { } -//withPathSeparator... func withPathSeparator(path string) string { if len(path) != 0 { path = constant.PATH_SEPARATOR + path diff --git a/metadata/identifier/metadata_identifier.go b/metadata/identifier/metadata_identifier.go index f3df8f36546093a826279c4e9ec1546f78d444bd..e97795b4cff95ed7bd1e535e391056fc9f4f8f23 100644 --- a/metadata/identifier/metadata_identifier.go +++ b/metadata/identifier/metadata_identifier.go @@ -17,17 +17,18 @@ package identifier +// The MetadataIdentifier is used to store method descriptor type MetadataIdentifier struct { application string BaseMetadataIdentifier } -// getIdentifierKey... +// getIdentifierKey gets metadata identifier key by @mdi.application func (mdi *MetadataIdentifier) getIdentifierKey(params ...string) string { return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.application) } -// getIdentifierKey... +// getIdentifierKey gets metadata file path key by @mdi.application func (mdi *MetadataIdentifier) getFilePathKey(params ...string) string { return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.application) } diff --git a/metadata/identifier/service_metadata_identifier.go b/metadata/identifier/service_metadata_identifier.go index 373df0130dd1f87e3175918bde50060c4be89616..b89641caac0289b0eb1903208678a212c510c0aa 100644 --- a/metadata/identifier/service_metadata_identifier.go +++ b/metadata/identifier/service_metadata_identifier.go @@ -27,12 +27,12 @@ type ServiceMetadataIdentifier struct { BaseMetadataIdentifier } -// getIdentifierKey... +// getIdentifierKey gets metadata identifier key by @mdi.protocol and @mdi.revision func (mdi *ServiceMetadataIdentifier) getIdentifierKey(params ...string) string { - return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.protocol + constant.KEY_REVISON_PREFIX + mdi.revision) + return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.protocol, constant.KEY_REVISON_PREFIX, mdi.revision) } -// getIdentifierKey... +// getFilePathKey gets metadata file path key by @mdi.protocol and @mdi.revision func (mdi *ServiceMetadataIdentifier) getFilePathKey(params ...string) string { - return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.protocol + constant.KEY_REVISON_PREFIX + mdi.revision) + return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.protocol, constant.KEY_REVISON_PREFIX, mdi.revision) } diff --git a/metadata/identifier/subscribe_metadata_identifier.go b/metadata/identifier/subscribe_metadata_identifier.go index 321a216a3e3ad3f2390ab832782924a81e226160..917e8e63082b85ff99e2bfaccb9d5fe40c41bbb3 100644 --- a/metadata/identifier/subscribe_metadata_identifier.go +++ b/metadata/identifier/subscribe_metadata_identifier.go @@ -22,12 +22,12 @@ type SubscriberMetadataIdentifier struct { BaseMetadataIdentifier } -// getIdentifierKey... +// getIdentifierKey gets metadata identifier key by @mdi.revision func (mdi *SubscriberMetadataIdentifier) getIdentifierKey(params ...string) string { return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.revision) } -// getIdentifierKey... +// getFilePathKey gets metadata file path key by @mdi.revision func (mdi *SubscriberMetadataIdentifier) getFilePathKey(params ...string) string { return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.revision) } diff --git a/metadata/service.go b/metadata/service.go index d85703c95a57183d5c0a5b2445839e946dc6a59b..89df68fb313b1abe63082c0c220b0114c11fca19 100644 --- a/metadata/service.go +++ b/metadata/service.go @@ -22,6 +22,9 @@ import ( gxset "github.com/dubbogo/gost/container/set" ) +// Metadata service is a built-in service around the metadata of Dubbo services, +// whose interface is provided by Dubbo Framework and exported automatically before subscription after other services exporting, +// which may be used for Dubbo subscribers and admin. type MetadataService interface { ServiceName() string ExportURL(url *common.URL) bool