diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2017-10-03 14:59:45 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2017-10-03 15:01:38 +0200 |
commit | 4de510778b6e55a2238374834d00b03726da76d4 (patch) | |
tree | 7b2d8b8f4db5d0bc2b81c8dfb31921fa59d45c6d /storage/filter | |
parent | db0c023fd0d756912c3f575c6ac65e99fda573cc (diff) | |
download | petrific-4de510778b6e55a2238374834d00b03726da76d4.tar.gz petrific-4de510778b6e55a2238374834d00b03726da76d4.tar.bz2 petrific-4de510778b6e55a2238374834d00b03726da76d4.zip |
Documentation
Diffstat (limited to 'storage/filter')
-rw-r--r-- | storage/filter/filter.go | 15 |
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 |