Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments for common directory #530

Merged
merged 7 commits into from
May 24, 2020

Conversation

watermelo
Copy link
Member

What this PR does:
Add comments

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@codecov-commenter
Copy link

codecov-commenter commented May 21, 2020

Codecov Report

Merging #530 into develop will decrease coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #530      +/-   ##
===========================================
- Coverage    66.56%   66.43%   -0.14%     
===========================================
  Files          184      184              
  Lines         9706     9706              
===========================================
- Hits          6461     6448      -13     
- Misses        2604     2616      +12     
- Partials       641      642       +1     
Impacted Files Coverage Δ
common/config/environment.go 52.38% <ø> (ø)
common/extension/auth.go 0.00% <ø> (ø)
common/extension/cluster.go 0.00% <ø> (ø)
common/extension/config_center.go 0.00% <ø> (ø)
common/extension/config_center_factory.go 0.00% <ø> (ø)
common/extension/config_reader.go 0.00% <ø> (ø)
common/extension/configurator.go 0.00% <ø> (ø)
common/extension/filter.go 0.00% <ø> (ø)
common/extension/graceful_shutdown.go 0.00% <ø> (ø)
common/extension/health_checker.go 66.66% <ø> (ø)
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2eee54...d0a770f. Read the comment docs.

@AlexStocks AlexStocks requested review from zouyx, AlexStocks and fangyincheng and removed request for zouyx and AlexStocks May 21, 2020 06:57
@@ -46,15 +46,15 @@ var (
once sync.Once
)

// GetEnvInstance ...
// GetEnvInstance get env instance by singleton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get -> gets? and the following errors should be fixed too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, find should be finds, update should be updates and so no

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@zouyx zouyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • use to -> use for?
  • get/set -> gets/sets?

Comment on lines 84 to 85
// List represents a doubly linked list.
// Configuration put externalConfigMap and appExternalConfigMap into list
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// List represents a doubly linked list.
// Configuration put externalConfigMap and appExternalConfigMap into list
// Configuration puts externalConfigMap and appExternalConfigMap into list
// List represents a doubly linked list.

@@ -61,7 +61,7 @@ func GetDefaultConfigurator(url *common.URL) config_center.Configurator {

}

// GetDefaultConfiguratorFunc ...
// GetDefaultConfiguratorFunc default configurator function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// GetDefaultConfiguratorFunc default configurator function
// GetDefaultConfiguratorFunc gets default configurator function

common/logger/logger.go Outdated Show resolved Hide resolved
@@ -145,13 +145,13 @@ func SetLoggerLevel(level string) bool {
return false
}

// OpsLogger ...
// OpsLogger used by the SetLoggerLevel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

type OpsLogger interface {
Logger
SetLoggerLevel(level string)
}

// SetLoggerLevel ...
// SetLoggerLevel used to set logger level
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

common/node.go Outdated
@@ -17,7 +17,7 @@

package common

// Node ...
// Node is used to process dubbo node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

common/url.go Outdated
@@ -86,7 +86,7 @@ type baseUrl struct {
PrimitiveURL string
}

// URL ...
// URL is used to locate resourse to transfer data between nodes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use for?

common/url.go Outdated
@@ -452,7 +454,7 @@ func (c URL) GetRawParam(key string) string {
}
}

// GetParamBool ...
// GetParamBool is used to judge whether key exists or not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use for?

common/url.go Outdated
@@ -432,7 +434,7 @@ func (c URL) GetParamAndDecoded(key string) (string, error) {
return value, err
}

// GetRawParam ...
// GetRawParam is used to get raw param
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use for?

Copy link
Contributor

@fangyincheng fangyincheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fangyincheng
Copy link
Contributor

please resolve conflicts

@@ -90,17 +91,17 @@ func (env *Environment) Configuration() *list.List {
return cfgList
}

// SetDynamicConfiguration ...
// SetDynamicConfiguration is used to set value for dynamicConfiguration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetDynamicConfiguration sets value for dynamicConfiguration

@@ -109,7 +110,7 @@ func newInmemoryConfiguration(p *sync.Map) *InmemoryConfiguration {
return &InmemoryConfiguration{store: p}
}

// GetProperty ...
// GetProperty is used the key to get value from InmemoryConfiguration instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetProperty gets value from InmemoryConfiguration instance by @key

func GetConfigReaders(name string) interfaces.ConfigReader {
if configReaders[name] == nil {
panic("config reader for " + name + " is not existing, make sure you have imported the package.")
}
return configReaders[name]()
}

// SetDefaultConfigReader set {name} to default config reader for {module}
// SetDefaultConfigReader sets {name} to default config reader for {module}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the different {name} and @name ?

@zouyx zouyx merged commit 9432c7a into apache:develop May 24, 2020
@zouyx zouyx linked an issue Jun 4, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhance] Add comments for common directory
5 participants