summaryrefslogtreecommitdiff
path: root/internal/config/common.go
blob: f0f1a94c743769b85d8ae666286edbeeb8b1c8e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package config

// CommonConfig stores configuration keys shared by DTail server and client.
type CommonConfig struct {
	SSHPort                    int
	ExperimentalFeaturesEnable bool `json:",omitempty"`
	DebugEnable                bool `json:",omitempty"`
	TraceEnable                bool `json:",omitempty"`
	// The log strategy to use, one of
	//   stdout: only log to stdout (useful when used with systemd)
	//   daily: create a log file for every day
	LogStrategy      string
	LogDir           string
	CacheDir         string
	TmpDir           string `json:",omitempty"`
	PProfEnable      bool   `json:",omitempty"`
	PProfPort        int    `json:",omitempty"`
	PProfBindAddress string `json:",omitempty"`
}

// Create a new default configuration.
func newDefaultCommonConfig() *CommonConfig {
	return &CommonConfig{
		SSHPort:                    2222,
		DebugEnable:                false,
		TraceEnable:                false,
		ExperimentalFeaturesEnable: false,
		LogDir:                     "log",
		CacheDir:                   "cache",
		TmpDir:                     "/tmp",
		PProfEnable:                false,
		PProfPort:                  6060,
		PProfBindAddress:           "0.0.0.0",
	}
}