forked from TrueCloudLab/neoneo-go
6b4dd5703e
There are no changes visible from the user side (at least for those users who doesn't put Prometheus's or pprof's port in quotes), just internal refactoring. From now and on, BasicService configuration is used by RPC server config, TLS for RPC server, pprof and Prometheus.
19 lines
484 B
Go
19 lines
484 B
Go
package config
|
|
|
|
import (
|
|
"net"
|
|
"strconv"
|
|
)
|
|
|
|
// BasicService is used as a simple base for node services like Pprof, RPC or
|
|
// Prometheus monitoring.
|
|
type BasicService struct {
|
|
Enabled bool `yaml:"Enabled"`
|
|
Address string `yaml:"Address"`
|
|
Port uint16 `yaml:"Port"`
|
|
}
|
|
|
|
// FormatAddress returns the full service's address in the form of "address:port".
|
|
func (s BasicService) FormatAddress() string {
|
|
return net.JoinHostPort(s.Address, strconv.FormatUint(uint64(s.Port), 10))
|
|
}
|