diff --git a/secconf/chain.go b/secconf/chain.go deleted file mode 100644 index 720cfa5..0000000 --- a/secconf/chain.go +++ /dev/null @@ -1,19 +0,0 @@ -package secconf - -// gip => encrypt => base64 -func StandardChainEncode(encrypt CodecFunc) Codec { - return CodecFuncChain([]CodecFunc{ - EncoderGZip, - encrypt, - EncoderBase64, - }) -} - -// base64 => decrypt => gzip -func StandardChainDecode(decrypt CodecFunc) Codec { - return CodecFuncChain([]CodecFunc{ - DecoderBase64, - decrypt, - DecoderGZip, - }) -} diff --git a/secconf/codec.go b/secconf/codec.go index 64df8d8..9a7877d 100644 --- a/secconf/codec.go +++ b/secconf/codec.go @@ -20,3 +20,21 @@ func (c CodecFuncChain) Apply(data []byte) (out []byte, err error) { type CodecFunc func(data []byte) ([]byte, error) func (f CodecFunc) Apply(data []byte) ([]byte, error) { return f(data) } + +// gip => encrypt => base64 +func StandardChainEncode(encrypt CodecFunc) Codec { + return CodecFuncChain([]CodecFunc{ + EncoderGZip, + encrypt, + EncoderBase64, + }) +} + +// base64 => decrypt => gzip +func StandardChainDecode(decrypt CodecFunc) Codec { + return CodecFuncChain([]CodecFunc{ + DecoderBase64, + decrypt, + DecoderGZip, + }) +}