diff options
| author | 2024-09-19 14:44:33 +0800 | |
|---|---|---|
| committer | 2024-09-19 14:44:33 +0800 | |
| commit | e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9 (patch) | |
| tree | a3e31e07fd001baa1cfce9ceebcdfed58b50bcda /hrc/config.py | |
| parent | 9e18d7ebf7a17bb7d7d169da3a3cefde0956a9f9 (diff) | |
| download | HydroRollCore-e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9.tar.gz HydroRollCore-e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9.zip | |
feat(core): Implement Service class and related functionalities
Co-authored-by: yuzhe <YUZHEthefool@users.noreply.github.com>
Diffstat (limited to 'hrc/config.py')
| -rw-r--r-- | hrc/config.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/hrc/config.py b/hrc/config.py index b6458b2..d179258 100644 --- a/hrc/config.py +++ b/hrc/config.py @@ -1,4 +1,4 @@ -from typing import Set, Union +from typing import Literal, Optional, Set, Union from pydantic import BaseModel, ConfigDict, DirectoryPath, Field @@ -14,16 +14,21 @@ class LogConfig(ConfigModel): verbose_exception: bool = False +class ServiceConfig(ConfigModel): + """Service configuration.""" + + class CoreConfig(ConfigModel): rules: Set[str] = Field(default_factory=set) rule_dirs: Set[DirectoryPath] = Field(default_factory=set) log: LogConfig = LogConfig() - + services: Set[str] = Field(default_factory=set) class RuleConfig(ConfigModel): - """rule configuration.""" - - + """Rule configuration.""" + + class MainConfig(ConfigModel): core: CoreConfig = CoreConfig() rule: RuleConfig = RuleConfig() + service: ServiceConfig = ServiceConfig() |
