aboutsummaryrefslogtreecommitdiff
path: root/storage/filter
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2017-10-03 14:59:45 +0200
committerLaria Carolin Chabowski <laria@laria.me>2017-10-03 15:01:38 +0200
commit4de510778b6e55a2238374834d00b03726da76d4 (patch)
tree7b2d8b8f4db5d0bc2b81c8dfb31921fa59d45c6d /storage/filter
parentdb0c023fd0d756912c3f575c6ac65e99fda573cc (diff)
downloadpetrific-4de510778b6e55a2238374834d00b03726da76d4.tar.gz
petrific-4de510778b6e55a2238374834d00b03726da76d4.tar.bz2
petrific-4de510778b6e55a2238374834d00b03726da76d4.zip
Documentation
Diffstat (limited to 'storage/filter')
-rw-r--r--storage/filter/filter.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/filter/filter.go b/storage/filter/filter.go
index 52ecbfd..1628c1e 100644
--- a/storage/filter/filter.go
+++ b/storage/filter/filter.go
@@ -34,6 +34,21 @@ func (pf PipeFilter) Transform(b []byte) ([]byte, error) {
return buf.Bytes(), nil
}
+// FilterSorage is a storage implementation wrapping around another storage, sending each raw object through an extrenal
+// binary for custom de/encoding (think encryption, compression, ...).
+//
+// It is used in a configuration by using the method "filter". It needs the config key "base" referencing the name of
+// another configured storage. Also needed are the string lists "decode" and "encode", describing which binary to call
+// with which parameters.
+//
+// For example, here is a configuration for a filter storage wrapping a storage "foo",
+// encrypting the content with gpg for the key "foobar"
+//
+// [storage.foo_encrypted]
+// method="filter"
+// base="foo"
+// encode=["gpg", "--encrypt", "--recipient", "foobar"]
+// decode=["gpg", "--decrypt"]
type FilterStorage struct {
Base storage.Storage
Decode, Encode Filter