Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/common-go/baseserver/config.go
2498 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package baseserver
6
7
type Configuration struct {
8
Services ServicesConfiguration `json:"services" yaml:"services"`
9
}
10
11
type ServicesConfiguration struct {
12
GRPC *ServerConfiguration `json:"grpc,omitempty" yaml:"grpc,omitempty"`
13
HTTP *ServerConfiguration `json:"http,omitempty" yaml:"http,omitempty"`
14
}
15
16
type ServerConfiguration struct {
17
Address string `json:"address" yaml:"address"`
18
TLS *TLSConfiguration `json:"tls,omitempty" yaml:"tls,omitempty"`
19
}
20
21
// GetAddress returns the configured address or an empty string of s is nil
22
func (s *ServerConfiguration) GetAddress() string {
23
if s == nil {
24
return ""
25
}
26
return s.Address
27
}
28
29
type TLSConfiguration struct {
30
CAPath string `json:"caPath" yaml:"caPath"`
31
CertPath string `json:"certPath" yaml:"certPath"`
32
KeyPath string `json:"keyPath" yaml:"keyPath"`
33
}
34
35