This commit is contained in:
2025-12-18 00:00:53 -06:00
parent fa4339768f
commit 6aa6c9e4dd
47 changed files with 752 additions and 894 deletions

View File

@@ -0,0 +1,28 @@
from dataclasses import dataclass
from typing import final
from docker_compose.compose.net_args_yaml import NetArgsYaml
@final
@dataclass(frozen=True, slots=True)
class NetArgs:
name: str
external: bool | None
@property
def as_dict(self) -> NetArgsYaml:
yaml_dict = NetArgsYaml(
name=self.name,
)
if self.external is not None:
yaml_dict["external"] = self.external
return yaml_dict
@staticmethod
def is_proxy_check(name: str) -> bool:
return name.endswith("proxy")
@property
def is_proxy(self) -> bool:
return self.is_proxy_check(self.name)