13493: Merge branch 'master' into 13493-federation-proxy
[arvados.git] / services / ws / config.go
index 9c2e80a1728afba9998d8a1b40d58b1ecd311b8f..ead1ec20c6a1de471e82f2e82ad0c24b5e3a4b93 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
 package main
 
 import (
@@ -6,30 +10,38 @@ import (
        "git.curoverse.com/arvados.git/sdk/go/arvados"
 )
 
-type Config struct {
-       Client   arvados.Client
-       Postgres pgConfig
-       Listen   string
-       Debug    bool
+type wsConfig struct {
+       Client       arvados.Client
+       Postgres     arvados.PostgreSQLConnection
+       PostgresPool int
+       Listen       string
+       LogLevel     string
+       LogFormat    string
 
        PingTimeout      arvados.Duration
        ClientEventQueue int
        ServerEventQueue int
+
+       ManagementToken string
 }
 
-func DefaultConfig() Config {
-       return Config{
+func defaultConfig() wsConfig {
+       return wsConfig{
                Client: arvados.Client{
                        APIHost: "localhost:443",
                },
-               Postgres: pgConfig{
-                       "dbname":          "arvados_production",
-                       "user":            "arvados",
-                       "password":        "xyzzy",
-                       "host":            "localhost",
-                       "connect_timeout": "30",
-                       "sslmode":         "require",
+               Postgres: arvados.PostgreSQLConnection{
+                       "dbname":                    "arvados_production",
+                       "user":                      "arvados",
+                       "password":                  "xyzzy",
+                       "host":                      "localhost",
+                       "connect_timeout":           "30",
+                       "sslmode":                   "require",
+                       "fallback_application_name": "arvados-ws",
                },
+               PostgresPool:     64,
+               LogLevel:         "info",
+               LogFormat:        "json",
                PingTimeout:      arvados.Duration(time.Minute),
                ClientEventQueue: 64,
                ServerEventQueue: 4,