canonical / microcluster

dqlite cluster management using go-dqlite
GNU Affero General Public License v3.0
22 stars 26 forks source link

Expose type for naming servers when adding additional network listeners #184

Open mas-who opened 1 month ago

mas-who commented 1 month ago

When adding additional network listeners in a downstream project using (microcluster.Microcluster).AddServers, we need to pass in a map of the type map[string]rest.Server. Since there are reserved names for microcluster internal network listeners such as core and unix, we should provide a server name type so that it is clear to the downstream project server names should be chosen with care.

roosterfish commented 1 month ago

@mas-who thanks for tracking this. After thinking through the details I am not so sure about this one anymore.

Let's say we would define a type ServerName string and derive two constants ServerNameCore and ServerNameUnix from it. I have the feeling this would indicate someone SHOULD use those constants as they already exist. So it would have the opposite effect of what we are trying to achieve.

Right now if you add additional servers by using either core or unix it will return an error. As this cannot happen during runtime (only when starting up), I guess we are fine leaving it like this?