Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blacha/cotar-rs
Cloud optimised tar files
https://github.com/blacha/cotar-rs
Last synced: about 18 hours ago
JSON representation
Cloud optimised tar files
- Host: GitHub
- URL: https://github.com/blacha/cotar-rs
- Owner: blacha
- Created: 2022-02-13T02:30:33.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-24T21:06:33.000Z (9 months ago)
- Last Synced: 2024-05-28T22:01:01.256Z (8 months ago)
- Language: Rust
- Size: 124 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cotar
Rust based [cotar](https://github.com/linz/cotar) reader
## CLI
Commands:
- `index` Create a tar index for a tar
- `validate` Validate tar index
- `from-mbtiles` Create a tar from a mbtiles archiveExamples
Create a tar index and validate itcreate `topographic.tar.index`
```
cotar index topographic.tar
```validate the new index
```
cotar validate topographic.tar topographic.tar.index
```Convert a mbtiles to a tar
```
cotar from-mbtiles topographic.mbtiles topographic.tarcotar index topographic.tar # creates topographic.tar.index
```## Library
```rust
use cotar;let mut ct = cotar::Cotar::from_tar("example.tar.co").expect("Failed to ::from_tar()");
let file_name = "tiles/8/247/108.pbf.gz";let file_info = ct.info(file_name).expect("Failed to .info()");
println!("ct.info('{}') {:?}", file_name, file_info);
// CotarIndexEntry { hash: 121498119488259422, offset: 7080448, size: 68 }let file_data = ct.get(file_name).expect("Failed to .get()");
println!("ct.get('{}') {:?}", file_name, file_data);
// [26, 66, 120 ... ]
```### Building
```
cargo build --release
```