MCPcopy Create free account
hub / github.com/Driver-C/tryssh / ResolveAlias

Function ResolveAlias

pkg/config/cache.go:24–31  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
24func 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.
34func FindAlias(alias string, conf *MainConfig) []ServerListConfig {

Calls

no outgoing calls