Nostro/interfaces/Nostro-Connector.cppm

19 lines
887 B
Text
Raw Permalink Normal View History

2026-11-01 18:35:23 +01:00
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
2026-10-06 15:39:17 +02:00
export module Nostro:Connector;
import std;
namespace Nostro {
2026-11-01 18:35:23 +01:00
// Both take an exclusive lock on connectors.lock in the config directory and hold it until the process ends, so
// a second nostro process waits (saying so through Note) instead of overwriting the first one's changes.
2026-10-06 15:39:17 +02:00
export struct Connector {
2026-11-01 18:35:23 +01:00
// Writes every bank's connectors to connectors.json in the config directory: synced to the disk, then
// renamed over the old file.
2026-10-06 15:39:17 +02:00
static void SaveConnectors();
2026-11-01 18:35:23 +01:00
// Reads connectors.json (a missing file is no connectors yet) and refreshes each connector's accounts. A
// connector whose refresh fails keeps no accounts and is reported through Note, so the others stay usable.
2026-10-06 15:39:17 +02:00
static void LoadConnectors();
};
}