-
Notifications
You must be signed in to change notification settings - Fork 4
/
standardconfiguration.go
43 lines (36 loc) · 1.32 KB
/
standardconfiguration.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
35
36
37
38
39
40
41
42
43
package backplane
// StandardConfiguration implements ConfigProvider
// you can use this as a helper in your own code
// to give users the ability to configure the backplane
type StandardConfiguration struct {
Brokers []string `json:"brokers" yaml:"brokers"`
AppName string `json:"name" yaml:"name"`
LogFilePath string `json:"logfile" yaml:"logfile"`
Loglevel string `json:"loglevel" yaml:"loglevel"`
TLSConf *TLSConf `json:"tls" yaml:"tls"`
Authorization Authorization `json:"auth" yaml:"auth"`
}
// MiddlewareHosts is the hosts that runs Choria Brokers in host:port format
func (s *StandardConfiguration) MiddlewareHosts() []string {
return s.Brokers
}
// Name is a name for the application which will be used as a name for the collective the nodes are in
func (s *StandardConfiguration) Name() string {
return s.AppName
}
// LogFile is the file to log to
func (s *StandardConfiguration) LogFile() string {
return s.LogFilePath
}
// LogLevel is the level to log at
func (s *StandardConfiguration) LogLevel() string {
return s.Loglevel
}
// TLS is the TLS configuration
func (s *StandardConfiguration) TLS() *TLSConf {
return s.TLSConf
}
// Auth is the authorized certificates for the backplane
func (s *StandardConfiguration) Auth() Authorization {
return s.Authorization
}