class documentation
class TemplateExpander(Resolver): (source)
Constructor: TemplateExpander(substitutions, next)
Resolver that applies simple string substitutions to results.
The resolver delegates to an underlying resolver and then replaces all occurrences of each key in substitutions with its corresponding value in the returned address string. This is intended for simple templating (for example replacing {domain}).
| Parameters | |
| substitutions | Mapping of substrings to replace in the resolved address. |
| next | Underlying resolver to obtain the initial address. |
| Method | __init__ |
Undocumented |
| Method | resolve |
Resolve via the underlying resolver and apply substitutions. |
| Instance Variable | _next |
Undocumented |
| Instance Variable | _substitutions |
Undocumented |
overrides
nebius.base.resolver.Resolver.resolveResolve via the underlying resolver and apply substitutions.
| Parameters | |
servicestr | Service identifier to resolve. |
| Returns | |
str | The address after performing the configured replacements. |
| Raises | |
UnknownServiceError | propagated from the underlying resolver when it does not match the id. |