On 2024-04-19 10:34, Fiona Ebner wrote:
> Am 09.04.24 um 15:25 schrieb Lukas Wagner:
>> +/// Get a list of all notification targets.
>> +pub fn get_targets(config: &Config) -> Result<Vec<Target>, HttpError> {
>> + let mut targets = Vec::new();
>> +
>> + #[cfg(feature = "gotify")]
>> + for endpoint in gotify::get_endpoints(config)? {
>> + targets.push(Target {
>> + name: endpoint.name,
>> + origin: endpoint.origin.unwrap_or(Origin::UserCreated),
>> + endpoint_type: EndpointType::Gotify,
>> + disable: endpoint.disable,
>> + comment: endpoint.comment,
>> + })
>
> Would it make sense to have into() functions for
> {Gotify,Sendmail,Smtp}Config -> Target ?
That would indeed be a bit nicer - but I'll do that in a follow-up, since this
is
completely internal to proxmox-notify and is more 'style' than an actual issue
:)
Thanks!
--
- Lukas
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel