Commit Graph

23 Commits

Author SHA1 Message Date
Matthias Beyer 8a4bc0eba4 Simplify implementation of Wiki::all_ids()
This way we alter the underlying iterator for all wiki entries to only
iterate in the "wiki" collection of the store, which results in fewer
disk access because the internal iterator does not yield all pathes from
the store before filtering them.

Code which was used to implement the filter was removed (also from the
public interface of the library).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-11 03:22:56 +01:00
Matthias Beyer 9185abcfa5 Update copyright years
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-01-03 18:41:36 +01:00
Matthias Beyer 9fca66aa89 Forbid unsafe code in all crates 2018-11-11 13:05:55 +01:00
Matthias Beyer 4e516ee19d Update version strings
...for the next release, which will be imag 0.10.0!

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-10 11:56:37 +01:00
Matthias Beyer 17d4123898 Update dependencies from git versions to proper versions.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-09 22:14:11 +01:00
Matthias Beyer 029a3c448e Change WikiStore::create_wiki() interface
to also return the index page. This way a user of the library can use
the index page entry right away.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-11-06 20:35:18 +01:00
Matthias Beyer 2dc17f8bea libimagwiki: Move from error-chain to failure
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-10-30 18:46:28 +01:00
Matthias Beyer 5e4779c1f0 Update dependency: filters: 0.2 -> 0.3 2018-10-06 12:22:15 +02:00
Matthias Beyer 3d12998603 Update dependency: toml-query: 0.6 -> 0.7 2018-09-27 15:05:44 +02:00
Matthias Beyer 0a7afee454 Update dependency: error-chain: 0.11 -> 0.12 2018-09-27 15:05:25 +02:00
Matthias Beyer d4872f6da3 Optimize the Store::entries() interface
The previous iterator was implemented to simply fetch _all_ pathes from
the filesystem, no matter what.

With this implementation, this changes. The iterator now has
functionality to optimize the iteration, if only a subdirectory of the
store is required, for example `$STORE/foo`.

This is done via functionality where the underlying iterator gets
altered.

First of all, the interface was changed to return a `Entries` object,
which itself only covers the libimagstore-internal `PathIterator` type.
This type was changed so that the backend implementation provides an
"PathIterBuilder`, which builds the actual iterator object for the
`PathIterator` type.

The intermediate `StoreIdConstructingIterator` was merged into
`PathIterator` for simplicity.

The `Entries` type got functionality similar to the
`StoreIdIteratorWithStore` type for easier transition to the new API.
This should probably be removed at a later point, though.

As the `walkdir::WalkDir` type is not as nice as it could be, iterators
for two collections in the store could be built like this (untested):

    store
        .entries()?
        .in_collection("foo")
        .chain(store.entries()?.in_collection("bar"))

Functionality to exclude subdirectories is not possible with the current
`walkdir::WalkDir` implementation and has to be done during iteration,
with filtering (as usual).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-09-27 12:19:18 +02:00
Matthias Beyer 664edc7943 Update version string: 0.8.0 -> 0.9.0 2018-05-09 11:39:33 +02:00
Matthias Beyer 40688a3c2d Refactor libimagwiki to fit new store iterator interface 2018-05-01 17:44:01 +02:00
Matthias Beyer d2dceb6640 Update version numbers: 0.7.0 -> 0.8.0 2018-04-19 10:05:53 +02:00
Matthias Beyer adede7bf26 Remove notion of "main page" 2018-04-18 14:32:23 +02:00
Matthias Beyer 6f16924514 Remove functionality to delete whole wiki 2018-04-18 14:32:09 +02:00
Matthias Beyer 816708a1aa Add documentation for type 2018-04-16 10:53:23 +02:00
Matthias Beyer 8928f9cb94 Automatically create "index" and link new pages 2018-04-16 10:53:23 +02:00
Matthias Beyer 5e51a77b3f Add logging output 2018-04-15 10:27:33 +02:00
Matthias Beyer 918d7a76b6 Add Wiki::delete_entry() 2018-04-15 10:27:09 +02:00
Matthias Beyer 2b8a83d9a7 Add entry getter function 2018-04-15 10:27:09 +02:00
Matthias Beyer c242a362e4 Add id iterator 2018-04-15 10:27:09 +02:00
Matthias Beyer bb0d4319c3 Initial import: libimagwiki 2018-04-15 10:27:09 +02:00