Merge branch '12533-token-n-ip-logging'
[arvados.git] / services / ws / config.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package main
6
7 import (
8         "time"
9
10         "git.curoverse.com/arvados.git/sdk/go/arvados"
11 )
12
13 type wsConfig struct {
14         Client       arvados.Client
15         Postgres     pgConfig
16         PostgresPool int
17         Listen       string
18         LogLevel     string
19         LogFormat    string
20
21         PingTimeout      arvados.Duration
22         ClientEventQueue int
23         ServerEventQueue int
24
25         ManagementToken string
26 }
27
28 func defaultConfig() wsConfig {
29         return wsConfig{
30                 Client: arvados.Client{
31                         APIHost: "localhost:443",
32                 },
33                 Postgres: pgConfig{
34                         "dbname":                    "arvados_production",
35                         "user":                      "arvados",
36                         "password":                  "xyzzy",
37                         "host":                      "localhost",
38                         "connect_timeout":           "30",
39                         "sslmode":                   "require",
40                         "fallback_application_name": "arvados-ws",
41                 },
42                 PostgresPool:     64,
43                 LogLevel:         "info",
44                 LogFormat:        "json",
45                 PingTimeout:      arvados.Duration(time.Minute),
46                 ClientEventQueue: 64,
47                 ServerEventQueue: 4,
48         }
49 }