-
Notifications
You must be signed in to change notification settings - Fork 5
/
opts.go
23 lines (21 loc) · 800 Bytes
/
opts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package util
// Opts defines the configuration options for Spectrum.
type Opts struct {
// Addr is the address to listen on.
Addr string `yaml:"addr"`
// AutoLogin determines whether automatic login should be enabled.
AutoLogin bool `yaml:"auto_login"`
// LatencyInterval is the interval at which the latency of the connection is updated in milliseconds.
// Lower intervals provide more accurate latency but use more bandwidth.
LatencyInterval int64 `yaml:"latency_interval"`
// Token is the authentication token that Spectrum uses to authenticate with servers.
Token string `yaml:"token"`
}
// DefaultOpts returns the default configuration options for Spectrum.
func DefaultOpts() *Opts {
return &Opts{
Addr: ":19132",
AutoLogin: true,
LatencyInterval: 3000,
}
}