Experiment with addons

Addons allow to execute external programs in some context inside
docspell. Currently it is possible to run them after processing files.
Addons are provided by URLs to zip files.
This commit is contained in:
eikek
2022-04-22 14:07:28 +02:00
parent e04a76faa4
commit 7fdd78ad06
166 changed files with 8181 additions and 115 deletions

Binary file not shown.

Binary file not shown.

View File

@ -7,20 +7,25 @@
package docspell.files
import cats.effect._
import cats.effect.unsafe.implicits.global
import cats.implicits._
import fs2.io.file.{Files, Path}
import docspell.common.Glob
import docspell.logging.TestLoggingConfig
import munit._
class ZipTest extends FunSuite {
class ZipTest extends CatsEffectSuite with TestLoggingConfig {
val logger = docspell.logging.getLogger[IO]
val tempDir = ResourceFixture(
Files[IO].tempDirectory(Path("target").some, "zip-test-", None)
)
test("unzip") {
val zipFile = ExampleFiles.letters_zip.readURL[IO](8192)
val uncomp = zipFile.through(Zip.unzip(8192, Glob.all))
val unzip = zipFile.through(Zip.unzip(8192, Glob.all))
uncomp
unzip
.evalMap { entry =>
val x = entry.data.map(_ => 1).foldMonoid.compile.lastOrError
x.map { size =>
@ -35,6 +40,10 @@ class ZipTest extends FunSuite {
}
.compile
.drain
.unsafeRunSync()
}
tempDir.test("unzipTo directory tree") { _ =>
// val zipFile = ExampleFiles.zip_dirs_zip.readURL[IO](8192)
// zipFile.through(Zip.unzip(G))
}
}