summaryrefslogtreecommitdiff
path: root/src/index.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-11-12fix: unnecessary borrows, other things found by clippyLars Wirzenius1-2/+2
Sponsored-by: author
2022-04-16feat! change how chunk labels are serializedLars Wirzenius1-3/+3
Serialized labels now start with a type prefix: a character that says what type of label it is. This isn't strictly required: we _can_ just decide to always use a single type of checksum for all chunks in one backup, for one client, or in the whole repository. However, if it's ever possible to have more than one type, it helps debugging if every checksum, when serialized, is explicit about its type. Change things to use the new serialize method instead of the Display trait for Label. We're primarily serializing labels so they can be stored in a database, and used in URLs, only secondarily showing them to users. Sponsored-by: author
2022-04-16refactor: rename Checksum to LabelLars Wirzenius1-9/+9
Label is a clearer and more accurate name for the type now that it is not just a checksum. Also, serialize a Label in tests, rather than using string literals. This is more correct, and we'll be changing serialization later. Sponsored-by: author
2022-03-22feat! drop generation related fields from chunk metadataLars Wirzenius1-66/+6
Sponsored-by: author
2022-03-20feat! on server, store chunk label in column called "label"Lars Wirzenius1-9/+9
Sponsored-by: author
2022-03-13feat! rename metadata field "sha256" to "label"Lars Wirzenius1-7/+7
The field still contains a cleartext SHa256 of the cleartext chunk data, but this makes it clearer that it may contain other data. This is a breaking change: the server API won't work with an old client, and the new client won't work with an old server. To avoid the breakage would require more effort than is warranted at this time, given the very small number of users of Obnam. Sorry. Sponsored-by: author
2021-12-31docs: add documentation comments to crateLars Wirzenius1-1/+18
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-12-05chore: drop unused fields in struct IndexLars Wirzenius1-13/+2
At this point, I don't know why the fields were there, but they are now not used at all, so they can be dropped. Sponsored-by: author
2021-12-05chore: tidy up things found by newer Rust toolchainLars Wirzenius1-4/+4
Sponsored-by: author
2021-11-20chore: bump dependency on rusqlite to 0.26.1 and fix breakageLars Wirzenius1-4/+4
Sponsored-by: author
2021-10-10chore: drop debug eprintln! callsLars Wirzenius1-2/+0
They're not useful now. Should probably add logging, but that will have to wait until we have a good logging story. Sponsored-by: author
2021-09-18refactor: define a Checksum type and use it where appropriateLars Wirzenius1-7/+16
This will make it harder to compare, say, a SHA-256 and a SHA3, later, when we add more checksum types. Sponsored-by: author
2021-07-21Replace IndexResult with plain ResultAlexander Batischev1-19/+16
2021-03-27refactor: use idiomatic .is_empty() instead of comparing lengthLars Wirzenius1-1/+1
2021-03-27refactor: drop unnecessary clonesLars Wirzenius1-2/+2
2021-03-27refactor: drop unnecessary conversions to the same typeLars Wirzenius1-2/+2
2021-03-27refactor: rename ChunkId::from_str to ChunkId::recreateLars Wirzenius1-1/+1
Less confusion with FromStr::from_str this way.
2021-02-06feat: method for listing ids of chunks from file dataLars Wirzenius1-0/+15
This will be useful soon, to enable us to check how many chunks from file data there is in the repository, to check that an upcoming chunk size setting works. Also add an API call for returning the ids. Note that all of this is meant for testing only. It may be best to disable it in production builds, eventually.
2021-02-04refactor: have per-module error enumsLars Wirzenius1-18/+37
This means that a function that parses step bindings can't return an error that the document is missing a title. Such an error return would be nonsensical, and we use the Rust type system to prevent it, at a small cost of being a bit verbose. Additional benefit is that the library portion of Obnam doesn't return anyhow::Result values anymore.
2021-01-19refactor: use ChunkId directly in errors, instead of StringLars Wirzenius1-2/+2
2021-01-10feat! use SQLite db for chunk index on serverLars Wirzenius1-68/+181
This speeds startup a lot. However, the backup repository needs to be re-created from scratch and internal APIs have change in incompatible ways.
2020-09-19feat: search, delete chunks on chunk serverLars Wirzenius1-0/+33
Also heavily refactor the now-long scenario by splitting out a happy path and some unhappy paths.
2020-09-17feat: add an in-memory index of chunks for searchingLars Wirzenius1-0/+97