MCPcopy Index your code
hub / github.com/tailscale/tailscale / ParseAutoExitNodeString

Function ParseAutoExitNodeString

ipn/prefs.go:1171–1176  ·  view source on GitHub ↗

ParseAutoExitNodeString attempts to parse the given string as an [ExitNodeExpression]. It returns the parsed expression and true on success, or an empty string and false if the input does not appear to be an [ExitNodeExpression] (i.e., it doesn't start with "auto:"). It is mainly used to parse the

(s T)

Source from the content-addressed store, hash-verified

1169// It is mainly used to parse the [syspolicy.ExitNodeID] value
1170// when it is set to "auto:<expression>" (e.g., auto:any).
1171func ParseAutoExitNodeString[T ~string](s T) (_ ExitNodeExpression, ok bool) {
1172 if expr, ok := strings.CutPrefix(string(s), AutoExitNodePrefix); ok && expr != "" {
1173 return ExitNodeExpression(expr), true
1174 }
1175 return "", false
1176}

Callers 5

runSetFunction · 0.92
prefsFromUpArgsFunction · 0.92
SetUseExitNodeEnabledMethod · 0.92

Calls 1

ExitNodeExpressionTypeAlias · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…