yobi 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +93 -124
- data/lib/yobi/argv_builder.rb +5 -0
- data/lib/yobi/errors.rb +6 -10
- data/lib/yobi/fancy_hash.rb +31 -0
- data/lib/yobi/io_handle.rb +9 -7
- data/lib/yobi/{mount.rb → mount_handle.rb} +11 -10
- data/lib/yobi/repository/backup.rb +75 -85
- data/lib/yobi/repository/cat.rb +10 -0
- data/lib/yobi/repository/check.rb +61 -45
- data/lib/yobi/repository/diff.rb +130 -47
- data/lib/yobi/repository/dump.rb +1 -1
- data/lib/yobi/repository/find.rb +11 -33
- data/lib/yobi/repository/forget.rb +6 -48
- data/lib/yobi/repository/init.rb +70 -0
- data/lib/yobi/repository/key.rb +59 -52
- data/lib/yobi/repository/ls.rb +48 -37
- data/lib/yobi/repository/mount.rb +16 -18
- data/lib/yobi/repository/restore.rb +42 -40
- data/lib/yobi/repository/snapshots.rb +2 -29
- data/lib/yobi/repository/stats.rb +47 -4
- data/lib/yobi/repository/tag.rb +50 -35
- data/lib/yobi/repository.rb +8 -43
- data/lib/yobi/restic.rb +73 -32
- data/lib/yobi/restic_output.rb +169 -12
- data/lib/yobi/snapshot.rb +81 -2
- data/lib/yobi/version.rb +2 -2
- data/lib/yobi.rb +2 -1
- data/sig/yobi.rbs +252 -139
- metadata +5 -7
- data/Rakefile +0 -12
data/sig/yobi.rbs
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
module Yobi
|
|
2
2
|
VERSION: String
|
|
3
3
|
|
|
4
|
+
class FancyHash < Hash[String, untyped]
|
|
5
|
+
def initialize: (Hash[String, untyped] raw) -> void
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class Initialized < FancyHash
|
|
9
|
+
def id: () -> String
|
|
10
|
+
|
|
11
|
+
def repository: () -> String
|
|
12
|
+
end
|
|
13
|
+
|
|
4
14
|
class Error < StandardError
|
|
5
15
|
end
|
|
6
16
|
|
|
7
|
-
class ExitError <
|
|
17
|
+
class ExitError < FancyHash
|
|
8
18
|
LINE_PATTERN: Regexp
|
|
9
19
|
|
|
10
20
|
def self.from_output: (ResticOutput output) -> ExitError?
|
|
@@ -79,7 +89,7 @@ module Yobi
|
|
|
79
89
|
attr_reader io: IO
|
|
80
90
|
attr_reader pid: Integer
|
|
81
91
|
|
|
82
|
-
def initialize: (IO io, pid: Integer,
|
|
92
|
+
def initialize: (IO io, pid: Integer, output: ResticOutput, argv: Array[String]) -> void
|
|
83
93
|
|
|
84
94
|
def closed?: () -> bool
|
|
85
95
|
|
|
@@ -88,10 +98,10 @@ module Yobi
|
|
|
88
98
|
def each: () { (String chunk) -> void } -> void
|
|
89
99
|
end
|
|
90
100
|
|
|
91
|
-
class
|
|
101
|
+
class MountHandle
|
|
92
102
|
attr_reader mountpoint: String
|
|
93
103
|
|
|
94
|
-
def initialize: (wait_thr: Process::Waiter, mountpoint: String,
|
|
104
|
+
def initialize: (wait_thr: Process::Waiter, mountpoint: String, pipe: IO, output: ResticOutput, argv: Array[String]) -> void
|
|
95
105
|
|
|
96
106
|
def pid: () -> Integer
|
|
97
107
|
|
|
@@ -103,7 +113,9 @@ module Yobi
|
|
|
103
113
|
class ResticOutput
|
|
104
114
|
DEFAULT_TAIL_CHUNK_SIZE: Integer
|
|
105
115
|
|
|
106
|
-
|
|
116
|
+
attr_reader file: File
|
|
117
|
+
|
|
118
|
+
def initialize: (?tail_chunk_size: Integer, ?transform: ^(Hash[String, untyped]) -> untyped) -> void
|
|
107
119
|
|
|
108
120
|
def index: () -> Hash[String, Array[Integer]]
|
|
109
121
|
|
|
@@ -114,10 +126,31 @@ module Yobi
|
|
|
114
126
|
def each_line: () { (String line) -> void } -> void
|
|
115
127
|
| () -> Enumerator[String, void]
|
|
116
128
|
|
|
117
|
-
def
|
|
129
|
+
def messages: [T] (?String? message_type) { (Hash[String, untyped] message) -> T } -> ResticOutput::LazyList[T]
|
|
130
|
+
| (?String? message_type) -> Enumerator[Hash[String, untyped], void]
|
|
131
|
+
|
|
132
|
+
def stderr_lines: () { (String line) -> void } -> void
|
|
133
|
+
| () -> Enumerator[String, void]
|
|
134
|
+
|
|
135
|
+
def write_and_parse: (String line, (:stdout | :stderr) origin) -> untyped
|
|
136
|
+
|
|
137
|
+
class LazyList[Elem]
|
|
138
|
+
include Enumerable[Elem]
|
|
139
|
+
|
|
140
|
+
INSPECT_PREVIEW_SIZE: Integer
|
|
141
|
+
|
|
142
|
+
def initialize: (ResticOutput output, Array[Integer] offsets, ^(Hash[String, untyped]) -> Elem transform) -> void
|
|
143
|
+
|
|
144
|
+
def each: () { (Elem item) -> void } -> void
|
|
145
|
+
| () -> Enumerator[Elem, void]
|
|
146
|
+
|
|
147
|
+
def size: () -> Integer
|
|
148
|
+
|
|
149
|
+
alias length size
|
|
150
|
+
end
|
|
118
151
|
end
|
|
119
152
|
|
|
120
|
-
class Snapshot <
|
|
153
|
+
class Snapshot < FancyHash
|
|
121
154
|
def id: () -> String
|
|
122
155
|
|
|
123
156
|
def short_id: () -> String
|
|
@@ -131,9 +164,61 @@ module Yobi
|
|
|
131
164
|
def paths: () -> Array[String]
|
|
132
165
|
|
|
133
166
|
def parent_id: () -> String?
|
|
167
|
+
|
|
168
|
+
def summary: () -> SnapshotSummary
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
class SnapshotSummary < FancyHash
|
|
172
|
+
def backup_start: () -> Time?
|
|
173
|
+
|
|
174
|
+
def backup_end: () -> Time?
|
|
175
|
+
|
|
176
|
+
def files_new: () -> Integer
|
|
177
|
+
|
|
178
|
+
def files_changed: () -> Integer
|
|
179
|
+
|
|
180
|
+
def files_unmodified: () -> Integer
|
|
181
|
+
|
|
182
|
+
def dirs_new: () -> Integer
|
|
183
|
+
|
|
184
|
+
def dirs_changed: () -> Integer
|
|
185
|
+
|
|
186
|
+
def dirs_unmodified: () -> Integer
|
|
187
|
+
|
|
188
|
+
def data_blobs: () -> Integer
|
|
189
|
+
|
|
190
|
+
def tree_blobs: () -> Integer
|
|
191
|
+
|
|
192
|
+
def data_added: () -> Integer
|
|
193
|
+
|
|
194
|
+
def data_added_packed: () -> Integer
|
|
195
|
+
|
|
196
|
+
def total_files_processed: () -> Integer
|
|
197
|
+
|
|
198
|
+
def total_bytes_processed: () -> Integer
|
|
134
199
|
end
|
|
135
200
|
|
|
136
|
-
|
|
201
|
+
class RepositoryStats < FancyHash
|
|
202
|
+
def total_size: () -> Integer
|
|
203
|
+
|
|
204
|
+
def total_file_count: () -> Integer
|
|
205
|
+
|
|
206
|
+
def total_blob_count: () -> Integer
|
|
207
|
+
|
|
208
|
+
def snapshots_count: () -> Integer
|
|
209
|
+
|
|
210
|
+
def total_uncompressed_size: () -> Integer
|
|
211
|
+
|
|
212
|
+
def compression_ratio: () -> Float
|
|
213
|
+
|
|
214
|
+
def compression_progress: () -> Float
|
|
215
|
+
|
|
216
|
+
def compression_space_saving: () -> Float
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
type password = String | [:command, String] | [:file, String] | :insecure_no_password | (^() -> String)
|
|
220
|
+
type from_password = password | nil
|
|
221
|
+
type new_password = String | [:file, String] | :insecure_no_password | (^() -> String)
|
|
137
222
|
type backend_credentials = Hash[String, String] | (^() -> Hash[String, String])
|
|
138
223
|
type restic_or_path = Restic | String | nil
|
|
139
224
|
|
|
@@ -174,13 +259,11 @@ module Yobi
|
|
|
174
259
|
|
|
175
260
|
def append_global_flags: (ArgvBuilder a) -> void
|
|
176
261
|
|
|
177
|
-
def
|
|
178
|
-
|
|
179
|
-
def version: () -> Hash[String, untyped]
|
|
262
|
+
def version: () -> ResticVersion
|
|
180
263
|
|
|
181
264
|
def cache: (?cleanup: bool, ?max_age: String?, ?no_size: bool) -> true
|
|
182
265
|
|
|
183
|
-
def run: (Array[String] argv, ?extra_env: Hash[String, String], ?skip_version_check: bool) ?{ (
|
|
266
|
+
def run: (Array[String] argv, ?extra_env: Hash[String, String], ?skip_version_check: bool, ?output: ResticOutput?) ?{ (untyped message) -> void } -> execution
|
|
184
267
|
|
|
185
268
|
def self.dispatch: (execution execution) -> execution
|
|
186
269
|
|
|
@@ -189,7 +272,17 @@ module Yobi
|
|
|
189
272
|
|
|
190
273
|
def ensure_minimum_version!: () -> void
|
|
191
274
|
|
|
192
|
-
def run_mount: (Array[String] argv, mountpoint: String, ?extra_env: Hash[String, String], ?ready_timeout: Numeric) ->
|
|
275
|
+
def run_mount: (Array[String] argv, mountpoint: String, ?extra_env: Hash[String, String], ?ready_timeout: Numeric) -> MountHandle
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
class ResticVersion < FancyHash
|
|
279
|
+
def version: () -> String
|
|
280
|
+
|
|
281
|
+
def go_version: () -> String?
|
|
282
|
+
|
|
283
|
+
def go_os: () -> String?
|
|
284
|
+
|
|
285
|
+
def go_arch: () -> String?
|
|
193
286
|
end
|
|
194
287
|
|
|
195
288
|
class Repository
|
|
@@ -197,17 +290,19 @@ module Yobi
|
|
|
197
290
|
attr_reader password: password
|
|
198
291
|
attr_reader backend_credentials: backend_credentials
|
|
199
292
|
|
|
200
|
-
def initialize: (url: String,
|
|
293
|
+
def initialize: (url: String, password: password, ?backend_credentials: backend_credentials, ?restic: restic_or_path) -> void
|
|
201
294
|
|
|
202
295
|
def env: () -> Hash[String, String]
|
|
203
296
|
|
|
204
|
-
def
|
|
297
|
+
def init: (?copy_chunker_params: bool, ?from_key_hint: String?, ?from_password: from_password,
|
|
298
|
+
?from_repo: String | Repository | nil, ?from_repository_file: String?, ?repository_version: String?) -> Initialized
|
|
299
|
+
|
|
300
|
+
def init_mirror: (url: String, password: password, ?backend_credentials: backend_credentials,
|
|
301
|
+
?restic: restic_or_path, ?repository_version: String?) -> Repository
|
|
205
302
|
|
|
206
|
-
def
|
|
207
|
-
?from_password_command: String?, ?from_password_file: String?, ?from_repo: String?,
|
|
208
|
-
?from_repository_file: String?, ?repository_version: String?) -> Hash[String, untyped]
|
|
303
|
+
def cat_config: () -> Hash[String, untyped]
|
|
209
304
|
|
|
210
|
-
|
|
305
|
+
alias config cat_config
|
|
211
306
|
|
|
212
307
|
def backup: (source: String | [:stdin_from_command, String | Array[String]] | [:stdin_from_command, String | Array[String], String],
|
|
213
308
|
?excludes: Array[String] | String, ?exclude_files: Array[String] | String,
|
|
@@ -219,7 +314,7 @@ module Yobi
|
|
|
219
314
|
?host: String?, ?ignore_ctime: bool, ?ignore_inode: bool, ?no_scan: bool,
|
|
220
315
|
?one_file_system: bool, ?parent: String?, ?read_concurrency: Integer?,
|
|
221
316
|
?skip_if_unchanged: bool, ?time: String?, ?verbose: bool, ?with_atime: bool)
|
|
222
|
-
?{ (BackupStatus | BackupError | BackupVerboseStatus message) -> void } -> BackupOutcome
|
|
317
|
+
?{ (BackupStatus | BackupError | BackupVerboseStatus | BackupSummary message) -> void } -> BackupOutcome
|
|
223
318
|
|
|
224
319
|
def cat_snapshot: (String | Snapshot id) -> Hash[String, untyped]
|
|
225
320
|
|
|
@@ -240,7 +335,7 @@ module Yobi
|
|
|
240
335
|
def check: (?hosts: Array[String] | String, ?paths: Array[String] | String, ?read_data: bool,
|
|
241
336
|
?read_data_subset: String?, ?tags: Array[String] | String, ?with_cache: bool) -> CheckOutcome
|
|
242
337
|
|
|
243
|
-
def copy: (from_repo: String | Repository, ?from_password:
|
|
338
|
+
def copy: (from_repo: String | Repository, ?from_password: from_password, ?snapshot_ids: Array[String] | String,
|
|
244
339
|
?from_key_hint: String?, ?from_repository_file: String?, ?hosts: Array[String] | String,
|
|
245
340
|
?paths: Array[String] | String, ?tags: Array[String] | String) -> true
|
|
246
341
|
|
|
@@ -257,7 +352,7 @@ module Yobi
|
|
|
257
352
|
def find: (patterns: Array[String] | String, ?blob: bool, ?pack: bool, ?tree: bool,
|
|
258
353
|
?hosts: Array[String] | String, ?human_readable: bool, ?ignore_case: bool, ?long: bool,
|
|
259
354
|
?newest: String?, ?oldest: String?, ?paths: Array[String] | String, ?reverse: bool,
|
|
260
|
-
?show_pack_id: bool, ?snapshot_ids: Array[String] | String, ?tags: Array[String] | String) ->
|
|
355
|
+
?show_pack_id: bool, ?snapshot_ids: Array[String] | String, ?tags: Array[String] | String) -> Array[MatchesPerSnapshot]
|
|
261
356
|
|
|
262
357
|
def forget: (?keep_last: Integer?, ?keep_hourly: Integer?, ?keep_daily: Integer?, ?keep_weekly: Integer?,
|
|
263
358
|
?keep_monthly: Integer?, ?keep_yearly: Integer?, ?keep_within: String?, ?keep_within_hourly: String?,
|
|
@@ -266,19 +361,19 @@ module Yobi
|
|
|
266
361
|
?tags: Array[String] | String, ?paths: Array[String] | String, ?compact: bool, ?group_by: String?,
|
|
267
362
|
?dry_run: bool, ?prune: bool, ?unsafe_allow_remove_all: bool, ?max_unused: String?,
|
|
268
363
|
?max_repack_size: String?, ?repack_cacheable_only: bool, ?repack_uncompressed: bool,
|
|
269
|
-
?repack_smaller_than: String?) ->
|
|
364
|
+
?repack_smaller_than: String?) -> Array[ForgetGroup]
|
|
270
365
|
|
|
271
|
-
def key_add: (
|
|
366
|
+
def key_add: (new_password: new_password, ?host: String?, ?user: String?) -> true
|
|
272
367
|
|
|
273
|
-
def add_key: (
|
|
368
|
+
def add_key: (new_password: new_password, ?host: String?, ?user: String?) -> true
|
|
274
369
|
|
|
275
|
-
def key_list: () ->
|
|
370
|
+
def key_list: () -> Array[Key]
|
|
276
371
|
|
|
277
|
-
def keys: () ->
|
|
372
|
+
def keys: () -> Array[Key]
|
|
278
373
|
|
|
279
|
-
def key_passwd: (
|
|
374
|
+
def key_passwd: (new_password: new_password, ?host: String?, ?user: String?) -> true
|
|
280
375
|
|
|
281
|
-
def change_password: (
|
|
376
|
+
def change_password: (new_password: new_password, ?host: String?, ?user: String?) -> true
|
|
282
377
|
|
|
283
378
|
def key_remove: (id: String) -> true
|
|
284
379
|
|
|
@@ -295,11 +390,11 @@ module Yobi
|
|
|
295
390
|
def mount: (mountpoint: String, ?hosts: Array[String] | String, ?paths: Array[String] | String,
|
|
296
391
|
?tags: Array[String] | String, ?allow_other: bool, ?no_default_permissions: bool,
|
|
297
392
|
?owner_root: bool, ?path_templates: Array[String] | String, ?time_template: String?,
|
|
298
|
-
?ready_timeout: Numeric) { (
|
|
393
|
+
?ready_timeout: Numeric) { (MountHandle mount) -> untyped } -> untyped
|
|
299
394
|
| (mountpoint: String, ?hosts: Array[String] | String, ?paths: Array[String] | String,
|
|
300
395
|
?tags: Array[String] | String, ?allow_other: bool, ?no_default_permissions: bool,
|
|
301
396
|
?owner_root: bool, ?path_templates: Array[String] | String, ?time_template: String?,
|
|
302
|
-
?ready_timeout: Numeric) ->
|
|
397
|
+
?ready_timeout: Numeric) -> MountHandle
|
|
303
398
|
|
|
304
399
|
def prune: (?dry_run: bool, ?max_repack_size: String?, ?max_unused: String?,
|
|
305
400
|
?repack_cacheable_only: bool, ?repack_smaller_than: String?, ?repack_uncompressed: bool,
|
|
@@ -333,10 +428,10 @@ module Yobi
|
|
|
333
428
|
?new_time: String?, ?snapshot_summary: bool) -> true
|
|
334
429
|
|
|
335
430
|
def snapshots: (?tags: Array[String] | String, ?hosts: Array[String] | String,
|
|
336
|
-
?paths: Array[String] | String, ?compact: bool, ?group_by: String?, ?latest: Integer?) ->
|
|
431
|
+
?paths: Array[String] | String, ?compact: bool, ?group_by: String?, ?latest: Integer?) -> Array[Snapshot]
|
|
337
432
|
|
|
338
433
|
def stats: (?snapshot_ids: Array[String] | String, ?hosts: Array[String] | String,
|
|
339
|
-
?mode: String | Symbol | nil, ?paths: Array[String] | String, ?tags: Array[String] | String) ->
|
|
434
|
+
?mode: String | Symbol | nil, ?paths: Array[String] | String, ?tags: Array[String] | String) -> RepositoryStats
|
|
340
435
|
|
|
341
436
|
def tag: (?snapshot_ids: Array[String] | String, ?add: Array[String] | String,
|
|
342
437
|
?remove: Array[String] | String, ?set: Array[String] | String, ?tags: Array[String] | String,
|
|
@@ -345,24 +440,38 @@ module Yobi
|
|
|
345
440
|
def unlock: (?remove_all: bool) -> true
|
|
346
441
|
end
|
|
347
442
|
|
|
443
|
+
module BackupMessageWrapper
|
|
444
|
+
def self.call: (Hash[String, untyped] raw) -> (BackupStatus | BackupError | BackupVerboseStatus | BackupSummary | Hash[String, untyped])
|
|
445
|
+
end
|
|
446
|
+
|
|
348
447
|
class BackupOutcome
|
|
349
|
-
attr_reader exit_code: Integer
|
|
350
448
|
attr_reader output: ResticOutput
|
|
351
449
|
|
|
352
450
|
COMMAND_OUTPUT_LINE_PATTERN: Regexp
|
|
353
451
|
|
|
354
|
-
def
|
|
452
|
+
def initialize: (execution execution) -> void
|
|
453
|
+
|
|
454
|
+
def errors: () -> ResticOutput::LazyList[BackupError]
|
|
355
455
|
|
|
356
|
-
def
|
|
456
|
+
def messages: () -> ResticOutput::LazyList[BackupStatus | BackupError | BackupVerboseStatus | BackupSummary | Hash[String, untyped]]
|
|
357
457
|
|
|
358
|
-
def
|
|
458
|
+
def command_output: () { (String line) -> void } -> void
|
|
459
|
+
| () -> Enumerator[String, void]
|
|
359
460
|
|
|
360
|
-
def
|
|
461
|
+
def summary: () -> BackupSummary
|
|
361
462
|
|
|
362
|
-
|
|
463
|
+
alias report summary
|
|
464
|
+
|
|
465
|
+
def inspect: () -> String
|
|
363
466
|
end
|
|
364
467
|
|
|
365
|
-
class
|
|
468
|
+
class BackupSummary < FancyHash
|
|
469
|
+
def backup_start: () -> Time?
|
|
470
|
+
|
|
471
|
+
def backup_end: () -> Time?
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
class BackupStatus < FancyHash
|
|
366
475
|
def percent_done: () -> Float?
|
|
367
476
|
|
|
368
477
|
def total_files: () -> Integer?
|
|
@@ -378,7 +487,7 @@ module Yobi
|
|
|
378
487
|
def error_count: () -> Integer
|
|
379
488
|
end
|
|
380
489
|
|
|
381
|
-
class BackupError <
|
|
490
|
+
class BackupError < FancyHash
|
|
382
491
|
def message: () -> String?
|
|
383
492
|
|
|
384
493
|
def during: () -> String?
|
|
@@ -386,16 +495,7 @@ module Yobi
|
|
|
386
495
|
def item: () -> String?
|
|
387
496
|
end
|
|
388
497
|
|
|
389
|
-
class
|
|
390
|
-
include Enumerable[BackupError]
|
|
391
|
-
|
|
392
|
-
def initialize: (ResticOutput output) -> void
|
|
393
|
-
|
|
394
|
-
def each: () { (BackupError error) -> void } -> void
|
|
395
|
-
| () -> Enumerator[BackupError, void]
|
|
396
|
-
end
|
|
397
|
-
|
|
398
|
-
class BackupVerboseStatus < SimpleDelegator
|
|
498
|
+
class BackupVerboseStatus < FancyHash
|
|
399
499
|
def action: () -> String
|
|
400
500
|
|
|
401
501
|
def item: () -> String
|
|
@@ -413,53 +513,97 @@ module Yobi
|
|
|
413
513
|
def total_files: () -> Integer
|
|
414
514
|
end
|
|
415
515
|
|
|
516
|
+
module CheckMessageWrapper
|
|
517
|
+
def self.call: (Hash[String, untyped] raw) -> (CheckError | CheckSummary | Hash[String, untyped])
|
|
518
|
+
end
|
|
519
|
+
|
|
416
520
|
class CheckOutcome
|
|
417
|
-
attr_reader exit_code: Integer
|
|
418
521
|
attr_reader output: ResticOutput
|
|
419
522
|
|
|
420
|
-
def
|
|
523
|
+
def initialize: (execution execution) -> void
|
|
524
|
+
|
|
525
|
+
def summary: () -> CheckSummary
|
|
421
526
|
|
|
422
|
-
|
|
527
|
+
alias report summary
|
|
528
|
+
|
|
529
|
+
def errors: () -> ResticOutput::LazyList[CheckError]
|
|
423
530
|
end
|
|
424
531
|
|
|
425
|
-
class CheckError <
|
|
532
|
+
class CheckError < FancyHash
|
|
426
533
|
def message: () -> String
|
|
427
534
|
end
|
|
428
535
|
|
|
429
|
-
class
|
|
430
|
-
|
|
536
|
+
class CheckSummary < FancyHash
|
|
537
|
+
def num_errors: () -> Integer
|
|
538
|
+
|
|
539
|
+
def broken_packs: () -> Array[String]
|
|
431
540
|
|
|
432
|
-
def
|
|
541
|
+
def suggest_repair_index?: () -> bool
|
|
542
|
+
|
|
543
|
+
def suggest_prune?: () -> bool
|
|
544
|
+
end
|
|
433
545
|
|
|
434
|
-
|
|
435
|
-
|
|
546
|
+
module DiffMessageWrapper
|
|
547
|
+
def self.call: (Hash[String, untyped] raw) -> (DiffChange | DiffStatistics | Hash[String, untyped])
|
|
436
548
|
end
|
|
437
549
|
|
|
438
550
|
class DiffOutcome
|
|
439
|
-
attr_reader exit_code: Integer
|
|
440
551
|
attr_reader output: ResticOutput
|
|
441
552
|
|
|
442
|
-
def
|
|
553
|
+
def initialize: (execution execution) -> void
|
|
554
|
+
|
|
555
|
+
def statistics: () -> DiffStatistics
|
|
443
556
|
|
|
444
|
-
|
|
557
|
+
alias report statistics
|
|
558
|
+
|
|
559
|
+
def changes: () -> ResticOutput::LazyList[DiffChange]
|
|
445
560
|
end
|
|
446
561
|
|
|
447
|
-
class DiffChange <
|
|
562
|
+
class DiffChange < FancyHash
|
|
448
563
|
def path: () -> String
|
|
449
564
|
|
|
450
565
|
def modifier: () -> String
|
|
566
|
+
|
|
567
|
+
def added?: () -> bool
|
|
568
|
+
|
|
569
|
+
def removed?: () -> bool
|
|
570
|
+
|
|
571
|
+
def type_changed?: () -> bool
|
|
572
|
+
|
|
573
|
+
def modified?: () -> bool
|
|
574
|
+
|
|
575
|
+
def metadata_updated?: () -> bool
|
|
576
|
+
|
|
577
|
+
def bitrot?: () -> bool
|
|
451
578
|
end
|
|
452
579
|
|
|
453
|
-
class
|
|
454
|
-
|
|
580
|
+
class DiffStatistics < FancyHash
|
|
581
|
+
def source_snapshot: () -> String?
|
|
582
|
+
|
|
583
|
+
def target_snapshot: () -> String?
|
|
455
584
|
|
|
456
|
-
def
|
|
585
|
+
def changed_files: () -> Integer
|
|
457
586
|
|
|
458
|
-
def
|
|
459
|
-
|
|
587
|
+
def added: () -> DiffStat
|
|
588
|
+
|
|
589
|
+
def removed: () -> DiffStat
|
|
460
590
|
end
|
|
461
591
|
|
|
462
|
-
class
|
|
592
|
+
class DiffStat < FancyHash
|
|
593
|
+
def files: () -> Integer
|
|
594
|
+
|
|
595
|
+
def dirs: () -> Integer
|
|
596
|
+
|
|
597
|
+
def others: () -> Integer
|
|
598
|
+
|
|
599
|
+
def data_blobs: () -> Integer
|
|
600
|
+
|
|
601
|
+
def tree_blobs: () -> Integer
|
|
602
|
+
|
|
603
|
+
def bytes: () -> Integer
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
class FindMatch < FancyHash
|
|
463
607
|
def path: () -> String
|
|
464
608
|
|
|
465
609
|
def type: () -> String
|
|
@@ -485,42 +629,17 @@ module Yobi
|
|
|
485
629
|
def ctime: () -> Time
|
|
486
630
|
end
|
|
487
631
|
|
|
488
|
-
class MatchesPerSnapshot <
|
|
489
|
-
def snapshot: () ->
|
|
632
|
+
class MatchesPerSnapshot < FancyHash
|
|
633
|
+
def snapshot: () -> String
|
|
634
|
+
|
|
635
|
+
alias snapshot_id snapshot
|
|
490
636
|
|
|
491
637
|
def hits: () -> Integer
|
|
492
638
|
|
|
493
639
|
def matches: () -> Array[FindMatch]
|
|
494
640
|
end
|
|
495
641
|
|
|
496
|
-
class
|
|
497
|
-
include Enumerable[MatchesPerSnapshot]
|
|
498
|
-
|
|
499
|
-
attr_reader output: ResticOutput
|
|
500
|
-
|
|
501
|
-
def initialize: (ResticOutput output) -> void
|
|
502
|
-
|
|
503
|
-
def each: () { (MatchesPerSnapshot matches) -> void } -> void
|
|
504
|
-
| () -> Enumerator[MatchesPerSnapshot, void]
|
|
505
|
-
end
|
|
506
|
-
|
|
507
|
-
class ForgetGroups
|
|
508
|
-
include Enumerable[ForgetGroup]
|
|
509
|
-
|
|
510
|
-
attr_reader exit_code: Integer
|
|
511
|
-
attr_reader output: ResticOutput
|
|
512
|
-
|
|
513
|
-
def initialize: (Integer exit_code, ResticOutput output) -> void
|
|
514
|
-
|
|
515
|
-
def each: () { (ForgetGroup group) -> void } -> void
|
|
516
|
-
| () -> Enumerator[ForgetGroup, void]
|
|
517
|
-
|
|
518
|
-
def success?: () -> bool
|
|
519
|
-
|
|
520
|
-
def partial?: () -> bool
|
|
521
|
-
end
|
|
522
|
-
|
|
523
|
-
class ForgetGroup < SimpleDelegator
|
|
642
|
+
class ForgetGroup < FancyHash
|
|
524
643
|
def host: () -> String
|
|
525
644
|
|
|
526
645
|
def tags: () -> Array[String]
|
|
@@ -531,16 +650,16 @@ module Yobi
|
|
|
531
650
|
|
|
532
651
|
def remove: () -> Array[Snapshot]
|
|
533
652
|
|
|
534
|
-
def reasons: () -> Array[
|
|
653
|
+
def reasons: () -> Array[KeepReason]
|
|
535
654
|
end
|
|
536
655
|
|
|
537
|
-
class
|
|
656
|
+
class KeepReason < FancyHash
|
|
538
657
|
def snapshot: () -> Snapshot
|
|
539
658
|
|
|
540
659
|
def matches: () -> Array[String]
|
|
541
660
|
end
|
|
542
661
|
|
|
543
|
-
class Key <
|
|
662
|
+
class Key < FancyHash
|
|
544
663
|
def id: () -> String
|
|
545
664
|
|
|
546
665
|
def user_name: () -> String
|
|
@@ -552,27 +671,23 @@ module Yobi
|
|
|
552
671
|
def created: () -> Time
|
|
553
672
|
end
|
|
554
673
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
attr_reader output: ResticOutput
|
|
559
|
-
|
|
560
|
-
def initialize: (ResticOutput output) -> void
|
|
561
|
-
|
|
562
|
-
def each: () { (Key key) -> void } -> void
|
|
563
|
-
| () -> Enumerator[Key, void]
|
|
674
|
+
module LsMessageWrapper
|
|
675
|
+
def self.call: (Hash[String, untyped] raw) -> (Snapshot | Node | Hash[String, untyped])
|
|
564
676
|
end
|
|
565
677
|
|
|
566
678
|
class LsOutcome
|
|
567
|
-
attr_reader exit_code: Integer
|
|
568
679
|
attr_reader output: ResticOutput
|
|
569
680
|
|
|
681
|
+
def initialize: (execution execution) -> void
|
|
682
|
+
|
|
570
683
|
def snapshot: () -> Snapshot
|
|
571
684
|
|
|
572
|
-
def
|
|
685
|
+
def nodes: () -> ResticOutput::LazyList[Node]
|
|
686
|
+
|
|
687
|
+
alias entries nodes
|
|
573
688
|
end
|
|
574
689
|
|
|
575
|
-
class
|
|
690
|
+
class Node < FancyHash
|
|
576
691
|
def name: () -> String
|
|
577
692
|
|
|
578
693
|
def type: () -> String
|
|
@@ -596,23 +711,21 @@ module Yobi
|
|
|
596
711
|
def ctime: () -> Time
|
|
597
712
|
end
|
|
598
713
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
def initialize: (ResticOutput output) -> void
|
|
603
|
-
|
|
604
|
-
def each: () { (LsEntry entry) -> void } -> void
|
|
605
|
-
| () -> Enumerator[LsEntry, void]
|
|
714
|
+
module RestoreMessageWrapper
|
|
715
|
+
def self.call: (Hash[String, untyped] raw) -> (RestoreStatus | RestoreVerboseStatus | Hash[String, untyped])
|
|
606
716
|
end
|
|
607
717
|
|
|
608
718
|
class RestoreOutcome
|
|
609
|
-
attr_reader exit_code: Integer
|
|
610
719
|
attr_reader output: ResticOutput
|
|
611
720
|
|
|
612
|
-
def
|
|
721
|
+
def initialize: (execution execution) -> void
|
|
722
|
+
|
|
723
|
+
def summary: () -> Hash[String, untyped]
|
|
724
|
+
|
|
725
|
+
alias report summary
|
|
613
726
|
end
|
|
614
727
|
|
|
615
|
-
class RestoreStatus <
|
|
728
|
+
class RestoreStatus < FancyHash
|
|
616
729
|
def percent_done: () -> Float?
|
|
617
730
|
|
|
618
731
|
def total_files: () -> Integer?
|
|
@@ -624,7 +737,7 @@ module Yobi
|
|
|
624
737
|
def bytes_restored: () -> Integer?
|
|
625
738
|
end
|
|
626
739
|
|
|
627
|
-
class RestoreVerboseStatus <
|
|
740
|
+
class RestoreVerboseStatus < FancyHash
|
|
628
741
|
def action: () -> String
|
|
629
742
|
|
|
630
743
|
def item: () -> String
|
|
@@ -632,29 +745,29 @@ module Yobi
|
|
|
632
745
|
def size: () -> Integer
|
|
633
746
|
end
|
|
634
747
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
attr_reader output: ResticOutput
|
|
639
|
-
|
|
640
|
-
def initialize: (ResticOutput output) -> void
|
|
641
|
-
|
|
642
|
-
def each: () { (Snapshot snapshot) -> void } -> void
|
|
643
|
-
| () -> Enumerator[Snapshot, void]
|
|
748
|
+
module TagMessageWrapper
|
|
749
|
+
def self.call: (Hash[String, untyped] raw) -> (TagChange | TagSummary | Hash[String, untyped])
|
|
644
750
|
end
|
|
645
751
|
|
|
646
752
|
class TagOutcome
|
|
647
|
-
attr_reader exit_code: Integer
|
|
648
753
|
attr_reader output: ResticOutput
|
|
649
754
|
|
|
650
|
-
def
|
|
755
|
+
def initialize: (execution execution) -> void
|
|
756
|
+
|
|
757
|
+
def summary: () -> TagSummary
|
|
651
758
|
|
|
652
|
-
|
|
759
|
+
alias report summary
|
|
760
|
+
|
|
761
|
+
def changes: () -> ResticOutput::LazyList[TagChange]
|
|
653
762
|
end
|
|
654
763
|
|
|
655
|
-
class TagChange <
|
|
764
|
+
class TagChange < FancyHash
|
|
656
765
|
def old_snapshot_id: () -> String
|
|
657
766
|
|
|
658
767
|
def new_snapshot_id: () -> String
|
|
659
768
|
end
|
|
769
|
+
|
|
770
|
+
class TagSummary < FancyHash
|
|
771
|
+
def changed_snapshots: () -> Integer
|
|
772
|
+
end
|
|
660
773
|
end
|