summaryrefslogtreecommitdiff
path: root/internal/config/common.go
diff options
context:
space:
mode:
authorPaul Bütow <pbuetow@mimecast.com>2020-01-20 18:41:05 +0000
committerPaul Bütow <pbuetow@mimecast.com>2020-01-21 14:35:23 +0000
commitc128865c4c7411c29a59fca9a3a2f95537686d7b (patch)
tree193bccc70d942c8b70cc93fae2670263701e43aa /internal/config/common.go
parent3755a9911ecb05886577095f2b8cc8b9e4066a3a (diff)
Move commands to cmd/ and move internal dependencies to internal/
Diffstat (limited to 'internal/config/common.go')
-rw-r--r--internal/config/common.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/internal/config/common.go b/internal/config/common.go
new file mode 100644
index 0000000..8c07710
--- /dev/null
+++ b/internal/config/common.go
@@ -0,0 +1,42 @@
+package config
+
+// CommonConfig stores configuration keys shared by DTail server and client.
+type CommonConfig struct {
+ // The SSH server port number.
+ SSHPort int
+ // Enable experimental features.
+ ExperimentalFeaturesEnable bool `json:",omitempty"`
+ // Enable extra debug logging (used for deevlopment or debugging purpes only).
+ DebugEnable bool `json:",omitempty"`
+ // Enable extra trace logging (used for deevlopment or debugging purpes only).
+ 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
+ // The log directory
+ LogDir string
+ // The cache directory
+ CacheDir string
+ // Do we want to enable pperf http server?
+ PProfEnable bool `json:",omitempty"`
+ // The HTTP port used by PProf
+ PProfPort int `json:",omitempty"`
+ // The PProf HTTP server bind address
+ 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",
+ PProfEnable: false,
+ PProfPort: 6060,
+ PProfBindAddress: "0.0.0.0",
+ }
+}