ResolveAlias looks up the given alias in the server list and returns the corresponding IP address. If no match is found, the alias string itself is returned.
(alias string, conf *MainConfig)
| 22 | // ResolveAlias looks up the given alias in the server list and returns the |
| 23 | // corresponding IP address. If no match is found, the alias string itself is returned. |
| 24 | func ResolveAlias(alias string, conf *MainConfig) string { |
| 25 | for _, server := range conf.ServerLists { |
| 26 | if server.Alias == alias { |
| 27 | return server.IP |
| 28 | } |
| 29 | } |
| 30 | return alias |
| 31 | } |
| 32 | |
| 33 | // FindAlias returns all server list entries that have the specified alias. |
| 34 | func FindAlias(alias string, conf *MainConfig) []ServerListConfig { |
no outgoing calls