Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
garage_common.h
Go to the documentation of this file.
1 #ifndef GARAGE_COMMON_H_
2 #define GARAGE_COMMON_H_
3 /** \file */
4 
5 /** Execution mode to run garage tools in. */
6 enum class RunMode {
7  /** Default operation. Upload objects to server if necessary and relevant. */
8  kDefault = 0,
9  /** Dry run. Do not upload any objects. */
10  kDryRun,
11  /** Walk the entire tree (without uploading). Do not assume that if an object
12  * exists, its parents must also exist. */
13  kWalkTree,
14  /** Walk the entire tree and upload any missing objects. Do not assume that if
15  * an object exists, its parents must also exist. */
16  kPushTree,
17 };
18 
19 /** Types of OSTree objects, borrowed from libostree/ostree-core.h.
20  * Copied here to avoid a dependency. We do not currently handle types 5-7, and
21  * UNKNOWN is our own invention for pseudo-backwards compatibility.
22  *
23  * OSTREE_OBJECT_TYPE_FILE: Content; regular file, symbolic link
24  * OSTREE_OBJECT_TYPE_DIR_TREE: List of children (trees or files), and metadata
25  * OSTREE_OBJECT_TYPE_DIR_META: Directory metadata
26  * OSTREE_OBJECT_TYPE_COMMIT: Toplevel object, refers to tree and dirmeta for root
27  * OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT: Toplevel object, refers to a deleted commit
28  * OSTREE_OBJECT_TYPE_COMMIT_META: Detached metadata for a commit
29  * OSTREE_OBJECT_TYPE_PAYLOAD_LINK: Symlink to a .file given its checksum on the payload only.
30  *
31  * Enumeration for core object types; %OSTREE_OBJECT_TYPE_FILE is for
32  * content, the other types are metadata.
33  */
34 enum class OstreeObjectType {
35  OSTREE_OBJECT_TYPE_UNKNOWN = 0,
36  OSTREE_OBJECT_TYPE_FILE = 1, /* .file */
37  OSTREE_OBJECT_TYPE_DIR_TREE = 2, /* .dirtree */
38  OSTREE_OBJECT_TYPE_DIR_META = 3, /* .dirmeta */
39  OSTREE_OBJECT_TYPE_COMMIT = 4, /* .commit */
40  OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT = 5, /* .commit-tombstone */
41  OSTREE_OBJECT_TYPE_COMMIT_META = 6, /* .commitmeta */
42  OSTREE_OBJECT_TYPE_PAYLOAD_LINK = 7, /* .payload-link */
43 };
44 
45 #endif // GARAGE_COMMON_H_
RunMode::kPushTree
@ kPushTree
Walk the entire tree and upload any missing objects.
RunMode::kWalkTree
@ kWalkTree
Walk the entire tree (without uploading).
RunMode::kDryRun
@ kDryRun
Dry run.
OstreeObjectType
OstreeObjectType
Types of OSTree objects, borrowed from libostree/ostree-core.h.
Definition: garage_common.h:34
RunMode
RunMode
Execution mode to run garage tools in.
Definition: garage_common.h:6