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
8354e91a
Commit
8354e91a
authored
4 years ago
by
LaurenceLiZhixin
Browse files
Options
Downloads
Patches
Plain Diff
fix: some style bug
parent
042a53f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/config_api.go
+8
-1
8 additions, 1 deletion
config/config_api.go
with
8 additions
and
1 deletion
config/config_api.go
+
8
−
1
View file @
8354e91a
...
...
@@ -61,7 +61,7 @@ func NewDefaultRegistryConfig(protocol string) *RegistryConfig {
type
RegistryConfigOpt
func
(
config
*
RegistryConfig
)
*
RegistryConfig
func
NewRegistryConfig
(
opts
...
RegistryConfigOpt
)
*
RegistryConfig
{
newRegistryConfig
:=
NewDefaultRegistryConfig
(
"
none
"
)
newRegistryConfig
:=
NewDefaultRegistryConfig
(
""
)
for
_
,
v
:=
range
opts
{
newRegistryConfig
=
v
(
newRegistryConfig
)
}
...
...
@@ -168,6 +168,7 @@ func NewConsumerConfig(opts ...ConsumerConfigOpt) *ConsumerConfig {
}
return
newConfig
}
func
WithConsumerAppConfig
(
appConfig
*
ApplicationConfig
)
ConsumerConfigOpt
{
return
func
(
config
*
ConsumerConfig
)
*
ConsumerConfig
{
config
.
ApplicationConfig
=
appConfig
...
...
@@ -241,24 +242,28 @@ func WithReferenceRegistry(registry string) ReferenceConfigOpt {
return
config
}
}
func
WithReferenceProtocol
(
protocol
string
)
ReferenceConfigOpt
{
return
func
(
config
*
ReferenceConfig
)
*
ReferenceConfig
{
config
.
Protocol
=
protocol
return
config
}
}
func
WithReferenceInterface
(
interfaceName
string
)
ReferenceConfigOpt
{
return
func
(
config
*
ReferenceConfig
)
*
ReferenceConfig
{
config
.
InterfaceName
=
interfaceName
return
config
}
}
func
WithReferenceCluster
(
cluster
string
)
ReferenceConfigOpt
{
return
func
(
config
*
ReferenceConfig
)
*
ReferenceConfig
{
config
.
Cluster
=
cluster
return
config
}
}
func
WithReferenceMethod
(
methodName
,
retries
,
lb
string
)
ReferenceConfigOpt
{
return
func
(
config
*
ReferenceConfig
)
*
ReferenceConfig
{
config
.
Methods
=
append
(
config
.
Methods
,
&
MethodConfig
{
...
...
@@ -368,12 +373,14 @@ func WithServiceProtocol(protocol string) ServiceConfigOpt {
return
config
}
}
func
WithServiceInterface
(
interfaceName
string
)
ServiceConfigOpt
{
return
func
(
config
*
ServiceConfig
)
*
ServiceConfig
{
config
.
InterfaceName
=
interfaceName
return
config
}
}
func
WithServiceLoadBalance
(
lb
string
)
ServiceConfigOpt
{
return
func
(
config
*
ServiceConfig
)
*
ServiceConfig
{
config
.
Loadbalance
=
lb
...
...
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