address

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

func (*Address) Adjust

func (addr *Address) Adjust(
	machineHost string,
	defaultListenAddress string)

Adjust adjust address according to the rules: 1. If ListenAddress is not set, then use defaultListenAddress 2. if ServiceAddress is not set, then use ListenAddress 3. if machineHost is set, then replace the host of ServiceAddress with machineHost

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL