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)
| 1169 | // It is mainly used to parse the [syspolicy.ExitNodeID] value |
| 1170 | // when it is set to "auto:<expression>" (e.g., auto:any). |
| 1171 | func 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 | } |
searching dependent graphs…