Restructre AppSetting and address comments.

This commit is contained in:
arijitad
2020-07-23 10:00:16 +05:30
parent 80b19f918b
commit 01b6f1129c
28 changed files with 245 additions and 243 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ import (
type ESUriErorr struct{}
func (e *ESUriErorr) Error() string {
return "Wrong ElasticSearch URL format. Expected to be: scheme://Host/index_name"
return "Wrong ElasticSearch URL format. Expected to be: scheme://host/index_name"
}
type ESPlugin struct {
@@ -55,7 +55,7 @@ type ESRequestResponse struct {
// Parse ElasticSearch URI
//
// Proper format is: scheme://[userinfo@]Host/index_name
// Proper format is: scheme://[userinfo@]host/index_name
// userinfo is: user[:password]
// net/url.Parse() does not fail if scheme is not provided but actualy does not
// handle URI properly.
@@ -69,7 +69,7 @@ func parseURI(URI string) (err error, index string) {
return
}
// check URL validity by extracting Host and undex values.
// check URL validity by extracting host and index values.
host := parsedUrl.Host
urlPathParts := strings.Split(parsedUrl.Path, "/")
index = urlPathParts[len(urlPathParts)-1]