2022-07-08 16:10:46 +00:00
|
|
|
package config
|
|
|
|
|
2022-11-24 13:03:08 +00:00
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
|
|
|
|
// BasicService is used as a simple base for node services like Pprof, RPC or
|
|
|
|
// Prometheus monitoring.
|
2022-07-08 16:10:46 +00:00
|
|
|
type BasicService struct {
|
|
|
|
Enabled bool `yaml:"Enabled"`
|
|
|
|
Address string `yaml:"Address"`
|
2022-11-24 13:03:08 +00:00
|
|
|
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))
|
2022-07-08 16:10:46 +00:00
|
|
|
}
|