1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! The layout of an oxen-server's sync dir: which entries at its top are namespaces, which
//! directories inside a namespace are repositories, and where a repository placed by UUID lives.
use io;
use ;
use Uuid;
use crateOXEN_HIDDEN_DIR;
use crateOxenError;
/// Directory at the top of the sync dir holding the name table's env.
pub const NAME_TABLE_DIR: &str = "name_table";
/// Directory at the top of the sync dir holding the repositories placed by UUID.
const REPOS_DIR: &str = "repo";
/// File in the repos dir that tells it apart from a namespace called `repo`.
const REPOS_DIR_MARKER: &str = "placement-v2";
/// Entries at the top of the sync dir holding the server's own state rather than a namespace's
/// repositories, `.oxen` among them for the access-key store a server before 0.59.0 kept there. A
/// directory named for one of these is not reported as a namespace, so a namespace could not be
/// seen under that name either.
const SERVER_OWNED_DIRS: & = &;
/// Whether the entry named `name` at the top of the sync dir is a namespace rather than the
/// server's own state.
pub
/// Whether a namespace called `name`, compared ignoring case, would share a directory with the
/// server's own state.
pub
/// The directory the repository `repo_uuid` is placed in under `sync_dir`:
/// `repo/{uuid[0:2]}/{uuid[2:4]}/{uuid}`.
pub
/// The directory where `sync_dir` holds a namespace called `repo` rather than the repos dir,
/// if it does.
/// The namespace directories at the top of `sync_dir`, in path order.
/// The directories of the repositories placed by UUID under `sync_dir`, in path order. Empty when
/// nothing has been placed.
/// The repository directories in `namespace_dir`, in path order.
/// The entries of `dir` that `keep` accepts, in path order. An entry that cannot be read fails the
/// whole listing.