Namespaces, assemblies, projects and directories, the solution, binaries, images, systemd units, config paths, environment variables, protocol method names, the media type and the raw chunk magic all move to MoShiro/moshiro. Existing data and deployments are not compatible and must be recreated. Also fix the architecture tests after the solution layout change and make the update tests independent of their order.
22 lines
985 B
C#
22 lines
985 B
C#
using Fleet.Core;
|
|
|
|
namespace Fleet.Server;
|
|
|
|
/// <summary>Fleet 服务端需要的存储。产品可以自己实现(MoShiro 把它放进 moshiro.db)。</summary>
|
|
public interface IFleetStore
|
|
{
|
|
ValueTask<JoinTokenRecord?> FindJoinTokenAsync(ReadOnlyMemory<byte> tokenSha256, CancellationToken ct);
|
|
|
|
/// <summary>原子地把令牌使用次数加一。令牌已吊销、过期或用完时返回 false。</summary>
|
|
ValueTask<bool> TryConsumeJoinTokenAsync(string tokenId, long nowMs, CancellationToken ct);
|
|
|
|
ValueTask<Result<NodeRecord>> CreateNodeAsync(NewNode node, CancellationToken ct);
|
|
|
|
ValueTask<NodeRecord?> GetNodeAsync(NodeId id, CancellationToken ct);
|
|
|
|
/// <summary>按名称查找状态不是 pending 的节点(用于判断注册时的名称冲突)。</summary>
|
|
ValueTask<NodeRecord?> FindEstablishedNodeByNameAsync(string name, CancellationToken ct);
|
|
|
|
ValueTask UpdatePresenceAsync(NodeId id, Presence presence, CancellationToken ct);
|
|
}
|