Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
aca6f801
Commit
aca6f801
authored
5 years ago
by
vito.he
Browse files
Options
Downloads
Patches
Plain Diff
Mod:recycle refer
parent
067a9e53
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/instance/metedata_report.go
+10
-9
10 additions, 9 deletions
config/instance/metedata_report.go
config/metadata_report_config.go
+3
-2
3 additions, 2 deletions
config/metadata_report_config.go
metadata/report_factory.go
+1
-1
1 addition, 1 deletion
metadata/report_factory.go
with
14 additions
and
12 deletions
metadata
/instance.go
→
config
/instance
/metedata_report
.go
+
10
−
9
View file @
aca6f801
...
...
@@ -15,26 +15,27 @@
* limitations under the License.
*/
package
metadata
package
instance
import
(
"sync"
)
import
(
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/extension"
"
sync
"
"
github.com/apache/dubbo-go/metadata
"
)
var
(
instance
MetadataReport
instance
metadata
.
MetadataReport
once
sync
.
Once
)
// Get
Env
Instance ...
func
Init
(
url
*
common
.
URL
)
{
// Get
MetadataReport
Instance ...
func
GetMetadataReportInstance
(
url
*
common
.
URL
)
metadata
.
MetadataReport
{
once
.
Do
(
func
()
{
instance
=
extension
.
GetMetadataReportFactory
(
url
.
Protocol
)
.
c
reateMetadataReport
(
url
)
instance
=
extension
.
GetMetadataReportFactory
(
url
.
Protocol
)
.
C
reateMetadataReport
(
url
)
})
}
func
GetMetadataReportInstance
()
MetadataReport
{
return
instance
}
This diff is collapsed.
Click to expand it.
config/metadata_report_config.go
+
3
−
2
View file @
aca6f801
...
...
@@ -18,9 +18,9 @@
package
config
import
(
"github.com/apache/dubbo-go/metadata"
"net/url"
)
import
(
"github.com/creasty/defaults"
perrors
"github.com/pkg/errors"
...
...
@@ -29,6 +29,7 @@ import (
import
(
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/config/instance"
)
// MethodConfig ...
...
...
@@ -93,7 +94,7 @@ func startMetadataReport() error {
return
perrors
.
New
(
"MetadataConfig address can not be empty."
)
}
if
url
,
err
:=
consumerConfig
.
MetadataReportConfig
.
ToUrl
();
err
==
nil
{
metadata
.
Init
(
url
)
instance
.
GetMetadataReportInstance
(
url
)
}
else
{
return
perrors
.
New
(
"MetadataConfig is invalid!"
)
}
...
...
This diff is collapsed.
Click to expand it.
metadata/report_factory.go
+
1
−
1
View file @
aca6f801
...
...
@@ -24,5 +24,5 @@ var (
)
type
MetadataReportFactory
interface
{
c
reateMetadataReport
(
*
common
.
URL
)
MetadataReport
C
reateMetadataReport
(
*
common
.
URL
)
MetadataReport
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment