Locator
sereto.models.locator
¶
DomainLocatorModel
¶
Bases: SeretoBaseModel
Model representing a domain locator.
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['domain']
|
The discriminator for the locator type, which is always "domain". |
value |
str
|
The domain of the locator. |
description |
str | None
|
Optional description of the domain locator. |
Source code in sereto/models/locator.py
37 38 39 40 41 42 43 44 45 46 47 48 |
|
FileLocatorModel
¶
Bases: SeretoBaseModel
Model representing a file locator.
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['file']
|
The discriminator for the locator type, which is always "file". |
value |
str
|
The path to the file, may contain specific line. |
description |
str | None
|
Optional description of the file locator. |
Source code in sereto/models/locator.py
65 66 67 68 69 70 71 72 73 74 75 76 |
|
HostnameLocatorModel
¶
Bases: SeretoBaseModel
Model representing a hostname locator.
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['hostname']
|
The discriminator for the locator type, which is always "hostname". |
value |
str
|
The hostname of the locator. |
description |
str | None
|
Optional description of the hostname locator. |
Source code in sereto/models/locator.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
IpLocatorModel
¶
Bases: SeretoBaseModel
Model representing an IP locator.
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['ip']
|
The discriminator for the locator type, which is always "ip". |
value |
IPvAnyAddress | IPvAnyNetwork
|
The IP address or network of the locator. |
description |
str | None
|
Optional description of the IP locator. |
Source code in sereto/models/locator.py
51 52 53 54 55 56 57 58 59 60 61 62 |
|
UrlLocatorModel
¶
Bases: SeretoBaseModel
Model representing a URL locator.
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['url']
|
The discriminator for the locator type, which is always "url". |
value |
AnyUrl
|
The URL of the locator. |
description |
str | None
|
Optional description of the URL locator. |
Source code in sereto/models/locator.py
9 10 11 12 13 14 15 16 17 18 19 20 |
|
dump_locators_to_toml(locators)
¶
Dump locators to a TOML string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
locators
|
Iterable[LocatorModel]
|
An iterable of LocatorModel instances. |
required |
Returns:
Type | Description |
---|---|
str
|
A TOML formatted string representing the locators. |
Source code in sereto/models/locator.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|