aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/cmd
diff options
context:
space:
mode:
authorIgor D.C <igor.duarte.cardoso@intel.com>2020-07-29 01:37:15 +0000
committerIgor D.C <igor.duarte.cardoso@intel.com>2020-08-05 23:03:58 +0000
commit11dda8300d3872f9414e7fff0402fd6fcbf6d537 (patch)
tree623f1df58e6964c19eedae9cbd983a0971be26ee /src/dcm/cmd
parent2300429de7a5b316172c549456f91a68cba89f83 (diff)
DCM - fix code formatting via vscode (II)
Part two of fixing code format/syntax with Visual Studio Code. Furthermore, also switched line endings from CRLF to LF (all test files seemed to be ending this way, unlike the other Go files). Issue-ID: MULTICLOUD-1143 Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com> Change-Id: Iaae868c780a42ea82ca1208e3cbdc3ec6ffd1f97
Diffstat (limited to 'src/dcm/cmd')
-rw-r--r--src/dcm/cmd/main.go98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/dcm/cmd/main.go b/src/dcm/cmd/main.go
index 77d5348b..c08330fa 100644
--- a/src/dcm/cmd/main.go
+++ b/src/dcm/cmd/main.go
@@ -14,65 +14,65 @@ limitations under the License.
package main
import (
- "context"
- "log"
- "math/rand"
- "net/http"
- "os"
- "os/signal"
- "time"
+ "context"
+ "log"
+ "math/rand"
+ "net/http"
+ "os"
+ "os/signal"
+ "time"
- "github.com/onap/multicloud-k8s/src/dcm/api"
- "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/auth"
- "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/config"
- "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db"
- contextDb "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/contextdb"
- "github.com/gorilla/handlers"
+ "github.com/gorilla/handlers"
+ "github.com/onap/multicloud-k8s/src/dcm/api"
+ "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/auth"
+ "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/config"
+ contextDb "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/contextdb"
+ "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db"
)
func main() {
- rand.Seed(time.Now().UnixNano())
+ rand.Seed(time.Now().UnixNano())
- err := db.InitializeDatabaseConnection("mco")
- if err != nil {
- log.Println("Unable to initialize database connection...")
- log.Println(err)
- log.Fatalln("Exiting...")
- }
+ err := db.InitializeDatabaseConnection("mco")
+ if err != nil {
+ log.Println("Unable to initialize database connection...")
+ log.Println(err)
+ log.Fatalln("Exiting...")
+ }
- err = contextDb.InitializeContextDatabase()
- if err != nil {
- log.Println("Unable to initialize database connection...")
- log.Println(err)
- log.Fatalln("Exiting...")
- }
+ err = contextDb.InitializeContextDatabase()
+ if err != nil {
+ log.Println("Unable to initialize database connection...")
+ log.Println(err)
+ log.Fatalln("Exiting...")
+ }
- httpRouter := api.NewRouter(nil, nil, nil, nil, nil)
- loggedRouter := handlers.LoggingHandler(os.Stdout, httpRouter)
- log.Println("Starting Distributed Cloud Manager API")
+ httpRouter := api.NewRouter(nil, nil, nil, nil, nil)
+ loggedRouter := handlers.LoggingHandler(os.Stdout, httpRouter)
+ log.Println("Starting Distributed Cloud Manager API")
- httpServer := &http.Server{
- Handler: loggedRouter,
- Addr: ":" + config.GetConfiguration().ServicePort,
- }
+ httpServer := &http.Server{
+ Handler: loggedRouter,
+ Addr: ":" + config.GetConfiguration().ServicePort,
+ }
- connectionsClose := make(chan struct{})
- go func() {
- c := make(chan os.Signal, 1)
- signal.Notify(c, os.Interrupt)
- <-c
- httpServer.Shutdown(context.Background())
- close(connectionsClose)
- }()
+ connectionsClose := make(chan struct{})
+ go func() {
+ c := make(chan os.Signal, 1)
+ signal.Notify(c, os.Interrupt)
+ <-c
+ httpServer.Shutdown(context.Background())
+ close(connectionsClose)
+ }()
- tlsConfig, err := auth.GetTLSConfig("ca.cert", "server.cert", "server.key")
- if err != nil {
- log.Println("Error Getting TLS Configuration. Starting without TLS...")
- log.Fatal(httpServer.ListenAndServe())
- } else {
- httpServer.TLSConfig = tlsConfig
+ tlsConfig, err := auth.GetTLSConfig("ca.cert", "server.cert", "server.key")
+ if err != nil {
+ log.Println("Error Getting TLS Configuration. Starting without TLS...")
+ log.Fatal(httpServer.ListenAndServe())
+ } else {
+ httpServer.TLSConfig = tlsConfig
- err = httpServer.ListenAndServeTLS("", "")
- }
+ err = httpServer.ListenAndServeTLS("", "")
+ }
}