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
4228b303
Commit
4228b303
authored
4 years ago
by
cjp
Browse files
Options
Downloads
Patches
Plain Diff
fix go fmt
parent
abdc971e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/config_loader.go
+11
-12
11 additions, 12 deletions
config/config_loader.go
with
11 additions
and
12 deletions
config/config_loader.go
+
11
−
12
View file @
4228b303
...
...
@@ -87,15 +87,15 @@ func init() {
log
.
Printf
(
"[consumerInit] %#v"
,
errCon
)
//consumerConfig = nil
consumerConfig
=
NewConsumerConfig
(
WithConsumerAppConfig
(
NewDefaultApplicationConfig
()),
// default app config
WithConsumerConnTimeout
(
time
.
Second
*
3
),
// timeout
WithConsumerRequestTimeout
(
time
.
Second
*
3
),
// timeout
WithConsumerAppConfig
(
NewDefaultApplicationConfig
()),
// default app config
WithConsumerConnTimeout
(
time
.
Second
*
3
),
// timeout
WithConsumerRequestTimeout
(
time
.
Second
*
3
),
// timeout
WithConsumerRegistryConfig
(
"demoZk"
,
NewDefaultRegistryConfig
(
"zookeeper"
)),
// registry config
WithConsumerReferenceConfig
(
"UserProvider"
,
NewReferenceConfigByAPI
(
// set refer config
WithReferenceRegistry
(
"demoZk"
),
// registry key
WithReferenceProtocol
(
"dubbo"
),
// protocol
WithReferenceInterface
(
"com.ikurento.user.UserProvider"
),
// interface name
WithReferenceMethod
(
"GetUser"
,
"3"
,
"random"
),
// method and lb
WithReferenceRegistry
(
"demoZk"
),
// registry key
WithReferenceProtocol
(
"dubbo"
),
// protocol
WithReferenceInterface
(
"com.ikurento.user.UserProvider"
),
// interface name
WithReferenceMethod
(
"GetUser"
,
"3"
,
"random"
),
// method and lb
WithReferenceCluster
(
"failover"
),
)),
)
...
...
@@ -104,18 +104,17 @@ func init() {
// because we think read from config file is correct config
baseConfig
=
&
consumerConfig
.
BaseConfig
if
errPro
:=
ProviderInit
(
confProFile
);
errPro
!=
nil
{
log
.
Printf
(
"[providerInit] %#v"
,
errPro
)
providerConfig
=
NewProviderConfig
(
WithProviderAppConfig
(
NewDefaultApplicationConfig
()),
WithProviderProtocol
(
"dubbo"
,
"dubbo"
,
"20000"
),
// protocol and port
WithProviderProtocol
(
"dubbo"
,
"dubbo"
,
"20000"
),
// protocol and port
WithProviderRegistry
(
"demoZk"
,
NewDefaultRegistryConfig
(
"zookeeper"
)),
// registry config
WithProviderServices
(
"UserProvider"
,
NewServiceConfigByAPI
(
WithServiceRegistry
(
"demoZk"
),
// registry key, equal to upper line
WithServiceProtocol
(
"dubbo"
),
// export protocol
WithServiceRegistry
(
"demoZk"
),
// registry key, equal to upper line
WithServiceProtocol
(
"dubbo"
),
// export protocol
WithServiceInterface
(
"com.ikurento.user.UserProvider"
),
// interface id
WithServiceLoadBalance
(
"random"
),
// lb
WithServiceLoadBalance
(
"random"
),
// lb
WithServiceWarmUpTime
(
"100"
),
WithServiceCluster
(
"failover"
),
WithServiceMethod
(
"GetUser"
,
"1"
,
"random"
),
...
...
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