-
Notifications
You must be signed in to change notification settings - Fork 22
/
config.go
34 lines (28 loc) · 957 Bytes
/
config.go
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
package admin
import (
"os"
"path"
"code.vegaprotocol.io/vega/libs/config/encoding"
"code.vegaprotocol.io/vega/logging"
)
const namedLogger = "admin.server"
// ServerConfig contains the configuration for the admin server.
type ServerConfig struct {
SocketPath string `long:"socket-path" description:"Listen for connection on UNIX socket path <file-path>"`
HTTPPath string `long:"http-path" description:"Http path of the socket HTTP RPC server"`
}
// Config represents the configuration of the admin package.
type Config struct {
Level encoding.LogLevel `long:"log-level"`
Server ServerConfig `group:"Server" namespace:"server"`
}
// NewDefaultConfig creates an instance of the package specific configuration.
func NewDefaultConfig() Config {
return Config{
Level: encoding.LogLevel{Level: logging.InfoLevel},
Server: ServerConfig{
SocketPath: path.Join(os.TempDir(), "datanode.sock"),
HTTPPath: "/datanode/rpc",
},
}
}