Commit Graph

87 Commits

Author SHA1 Message Date
Kat Marchán 39f8ecd055
mmap file writes and add unindexed writing to cache 2020-07-18 10:14:50 -07:00
Kat Marchán d41bb21a69
added write_hash function 2020-07-17 17:31:27 -07:00
Florian Albertz bb815f5f22 feat(errors): remove anyhow and use custom error types (#24)
Co-authored-by: Florian Albertz <git@albertz.io>

BREAKING CHANGE: This changes the exported error type(s) for cacache, making it way easier to do error handling when something goes kaput.
2020-04-29 19:34:43 -07:00
Andreas Rammhold 88a76189fc
fix(list_sync): make sure the public interface allows using the Item type (#25)
Before this change the public interface wouldn't allow downstream users
to use the actual items since it wasn't communicated on the function
signature.

Previously a user would run into errors like this:
> no field `key` on type `<impl std::iter::Iterator as std::iter::Iterator>::Item`
2020-04-21 13:42:19 -07:00
Kat Marchán a9f8e4e6f4
cleanup: some reorganizing and reformatting of stuff 2019-11-06 23:03:14 -08:00
Kat Marchán d5bb0dffb6
feat(chown): stop changing owner/group on unix platforms
Fixes: #16

BREAKING CHANGE: If you were relying on the chown functionality for the index (which you probably weren't), then your index will no longer be updated that way.
2019-11-06 20:59:24 -08:00
Kat Marchán 743476b274
feat(api): rewrite entire API to be like std::fs (#21)
Fixes: #13

BREAKING CHANGE: The entire API surface has been rewritten and overhauled. Instead of breaking up the package into get/put/rm/ls modules, everything is now available mostly through the toplevel module, following the same conventions as std:fs for its operations. Associated structs and other types have also been renamed. Please refer to the documentation for the new API, and I hope you find it more ergonomic!
2019-10-23 21:17:57 -07:00
Kat Marchán ccdd8c7578
docs: improve examples 2019-10-21 18:28:00 -04:00
Kat Marchán 62298cdf35
feat(errors): improved errors messaging and context (#20)
Fixes: #19

BREAKING CHANGE: Error values have changed. If you were inspecting or
matching against actual return values, you'll need to change your code
to use the new enums.
2019-10-20 23:47:56 -04:00
Kat Marchán 649398512f
feat(rm): Accept AsRef<str> for keys 2019-10-20 23:08:26 -04:00
Kat Marchán ee149a70ca
feat(errors): Replace failure with anyhow crate (#17)
Fixes: #14

BREAKING CHANGE: Result functions now return anyhow::Error
2019-10-20 00:25:28 -04:00
Kat Marchán 38115599ca
fix(fmt): cargo fmt --all 2019-10-18 22:41:58 -04:00
Kat Marchán fde3521cce
deps: bump async_std 2019-10-18 22:24:42 -04:00
Kat Marchán 086cbfe379
docs: add a couple of examples to Put 2019-10-18 21:49:47 -04:00
Kat Marchán ef8d3ad0e7
docs: improve root examples a bit 2019-10-18 21:49:32 -04:00
Kat Marchán 57bc0f04ff
test(rm): add tests and examples for cacache::rm 2019-10-18 16:28:52 -04:00
Kat Marchán dafc79f481
feat(get): get::info -> get::entry
BREAKING CHANGE: This renames get::info to get::entry for better symmetry with rm
2019-10-18 16:28:15 -04:00
Kat Marchán 7123ffa44b
test(copy): add tests and doc examples for copy APIs 2019-10-18 12:44:48 -04:00
Kat Marchán c430016744
feat(ls): cacache::ls::all -> ls::all_sync
BREAKING CHANGE: In order to match up with the other APIs, the ls::all() has been renamed to ls::all_sync().
2019-10-17 23:16:51 -04:00
Kat Marchán a040a743a8
test(get): add examples and tests for get::data* family 2019-10-17 23:05:43 -04:00
Kat Marchán d08629cf55
fix(check): {Async}Get::check wasn't working correctly 2019-10-17 22:50:39 -04:00
Kat Marchán 03ff19709a
fix(open): use actual file paths instead of just cache for open APIs
Also taking the chance to write docs and tests for them.
2019-10-17 19:04:21 -04:00
Kat Marchán 662aea9b5a feat(async): reorganize async APIs to be the primary APIs
BREAKING CHANGE: the async_* namespaces are gone, and all the previously-sync APIs (get::data, put::data, etc), are all suffixed with _sync now. You'll need to adjust your usage accordingly.
2019-10-17 18:25:20 -04:00
Kat Marchán b02f41e07f feat(api): get::read -> get::data
This should improve the ergonomics a bit by being more symmetrical with put

BREAKING CHANGE: The `get` API now uses "data" instead of "read" as the "verb". You will need to change anything that used get::read/hash/etc to use "data" now.
2019-10-17 18:25:20 -04:00
Kat Marchán 7aabb55de5
misc: remove unneeded clippy exception 2019-10-17 18:10:18 -04:00
ricky 42f4e1da63 tests: add some rm (#10)
Ref: #3
2019-10-17 18:09:41 -04:00
Kat Marchán 4259a39fdf
docs: add basic examples 2019-10-15 13:08:02 -04:00
Kat Marchán 4d9404b9a6
feat(license): relicense to Parity+Apache 2019-10-15 12:15:34 -04:00
Kat Marchán 18190bfc35
feat(async): add extra async versions of APIs (#6) 2019-10-13 20:06:20 -04:00
Kat Marchán 473473e6b2
feat(license): relicense under MPL-2.0 (#8)
BREAKING CHANGE: The license terms have changed. Please refer to LICENSE in the root of this repository for details. Future use of this library may require release of source code for any changes applied to it.
2019-09-06 21:39:36 -07:00
Kat Marchán 97f44573d5
fix(windows): add windows support 2019-08-31 22:38:37 -07:00
Félix Saparelli ad74518a9d refactor(index): idiomatise various iterators (#1)
* chore(index): idiomatise variously

* chore(index): exploit hashset to dedupe entries

* chore(index): format
2019-07-01 08:46:08 -07:00
Kat Marchán 7f1602e28f
feat(put): privatize Put and PutOpts fields 2019-06-30 23:21:37 -07:00
Kat Marchán 87adc8cf9f
feat(exports): re-export ssri::Algorithm and serde_json::Value 2019-06-30 23:20:57 -07:00
Kat Marchán 329aee2205
meta(doc): increase doc-linting level 2019-06-30 23:20:34 -07:00
Kat Marchán d2d7170a9c
doc(error): document all errors 2019-06-30 23:20:01 -07:00
Kat Marchán da112036c1
doc(put): basic docs for put 2019-06-30 23:11:39 -07:00
Kat Marchán d7af45d4f1
doc(get): document get module 2019-06-30 20:53:50 -07:00
Kat Marchán 1133de04d2
doc(ls): document ls::all() 2019-06-30 20:20:49 -07:00
Kat Marchán fa8759b92c
doc(rm): document rm API functions 2019-06-30 20:18:47 -07:00
Kat Marchán 982f8ee51a
doc(index): document Entry 2019-06-30 20:13:40 -07:00
Kat Marchán 27ce700bd6
feat(put): make PutOpts Clone 2019-06-30 20:12:46 -07:00
Kat Marchán aee271186a
refactor(get): reuse open_hash 2019-06-30 20:12:31 -07:00
Kat Marchán 0349d115f4
fix(fmt): cargo fmt 2019-06-27 22:48:58 -07:00
Kat Marchán 4a6950ff5d
fix(put): fix warnings 2019-06-27 22:45:11 -07:00
Kat Marchán a5e9966624
refactor(get): move trait bounds into where clauses 2019-06-27 22:41:56 -07:00
Kat Marchán 6e9a2f9f87
feat(get): add get::open() and get::open_hash() 2019-06-27 22:41:32 -07:00
Kat Marchán 09ed932870
misc: add useful (?) comment 2019-06-27 11:18:42 -07:00
Kat Marchán abc0246da6
refactor: remove unneeded Ok() 2019-06-26 22:03:29 -07:00
Kat Marchán bc56a1b3fe
fix(fmt): cargo fmt 2019-06-26 21:41:44 -07:00