aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/compress.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-07-23 22:18:06 +0900
committerOphestra <cat@gensokyo.uk>2026-07-23 22:18:06 +0900
commit390f3b2daee0f81d97c4451015d08758418eba34 (patch)
tree11173206c253e760096391f9aea19cf4318256e3 /internal/pkg/compress.go
parent5d3e47d8e71b6c269f26c1dfe5b2de2e57f670d9 (diff)
internal/pkg: decompress zstd streams
This uses internal/zstd until compress/zstd becomes available. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/compress.go')
-rw-r--r--internal/pkg/compress.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/pkg/compress.go b/internal/pkg/compress.go
index 9a0c1152..62faf4fc 100644
--- a/internal/pkg/compress.go
+++ b/internal/pkg/compress.go
@@ -6,6 +6,8 @@ import (
"fmt"
"io"
"os"
+
+ "hakurei.app/internal/zstd"
)
const (
@@ -13,6 +15,8 @@ const (
Gzip = iota
// Bzip2 denotes a stream compressed via [bzip2].
Bzip2
+ // Zstd denotes a stream compressed via [zstd].
+ Zstd
)
// A decompressArtifact is a [FileArtifact] decompressing a backing
@@ -117,6 +121,12 @@ func (a *decompressArtifact) Cure(r *RContext) (io.ReadCloser, error) {
io.Closer
}{bzip2.NewReader(br), br}, nil
+ case Zstd:
+ return struct {
+ io.Reader
+ io.Closer
+ }{zstd.NewReader(br), br}, nil
+
default:
return nil, os.ErrInvalid
}