harp.services.references¶
- class BaseReference[source]¶
Bases:
BaseModelBase class for references. Mostly there to add some interface documentation.
Create a new model by parsing and validating input data from keyword arguments.
Raises
pydantic_core.ValidationErrorif the input data cannot be validated.- classmethod build_from_yaml(loader, node)[source]¶
Secondary constructor implementing the pyyaml constructor interface.
- Return type:
- __init__(**data)[source]¶
Create a new model by parsing and validating input data from keyword arguments.
Raises
pydantic_core.ValidationErrorif the input data cannot be validated.- Parameters:
data (Any)
- Return type:
None
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class LazyServiceReference[source]¶
Bases:
BaseReferenceReference to a service, that will be resolved the latest possible, when the instance will actually be needed.
Create a new model by parsing and validating input data from keyword arguments.
Raises
pydantic_core.ValidationErrorif the input data cannot be validated.- classmethod build_from_yaml(loader, node)[source]¶
Secondary constructor implementing the pyyaml constructor interface.
- Return type:
- resolve(resolver, context)[source]¶
Resolve reference value in using the given resolver (callable) and resolution context.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class LazySettingReference[source]¶
Bases:
BaseReferenceReference to a setting value, that will be resolved when the settings are bound to the service definitions collection, when calling
harp.services.Container.load().Use this in services.yml files using the !cfg constructor:
foo: !cfg "foo"
Can be provided a two-element list for defaults:
foo: !cfg ["foo", "default if no «foo» in bound settings"]
Create a new model by parsing and validating input data from keyword arguments.
Raises
pydantic_core.ValidationErrorif the input data cannot be validated.- classmethod build_from_yaml(loader, node)[source]¶
Secondary constructor implementing the pyyaml constructor interface.
- Return type:
- __init__(target=None, **kwargs)[source]¶
Create a new model by parsing and validating input data from keyword arguments.
Raises
pydantic_core.ValidationErrorif the input data cannot be validated.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].