Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct { // ListenAddress listen address ListenAddress string `toml:"listen-address"` // ServiceAddress service address ServiceAddress string `toml:"service-addresss"` }
Address is used to describe the address of a MO running service, divided into 2 addresses, ListenAddress and ServiceAddress.
ListenAddress is used to indicate the address of the service listener, used to accept external connections.
ServiceAddress is used to register to the HAKeeper address, other nodes can get this address to connect to this MO's service
TODO(fagongzi): refactor all address configurations in MO.
type AddressManager ¶ added in v1.0.0
type AddressManager interface { // Register registers a service by its name and port slot. Register(portSlot int) // ListenAddress returns the service address of the service. ListenAddress(slot int) string // ServiceAddress returns the service address of the service. ServiceAddress(slot int) string }
AddressManager manages all service names and ports. It uses unified listen address and service address. The port of each service is generated by port base and the port slot.
func NewAddressManager ¶ added in v1.0.0
func NewAddressManager(serviceAddress string, portBase int) AddressManager
Click to show internal directories.
Click to hide internal directories.