Documentation ¶
Index ¶
- Variables
- func NewDebug(prefix string, r io.Reader, w io.Writer) io.ReadWriter
- func NopCloser(w io.Writer) io.WriteCloser
- type AES
- type Base64
- type Buffer
- type Debug
- type EncodeDecoder
- type EncodeDecoderFn
- type EndErrors
- type Ender
- type Gzip
- type ReadClose
- type ReadEnder
- type Transformer
- type Transparent
- type WrapReadCloser
- type WriteClose
- type WriteEnder
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAESDecode = errors.New("wrong secret or corrupted data")
Functions ¶
Types ¶
type EncodeDecoder ¶
type EncodeDecoder interface { // Encoder returns a writer that will encode data to out. // When the Close method is called, it should not close the underlying writer, // it should only flush the pending data from buffer. Encoder(out io.Writer) (io.WriteCloser, error) // Decoder returns a reader that will decode the data from in. Decoder(in io.Reader) (io.ReadCloser, error) }
func Join ¶
func Join(list ...EncodeDecoder) EncodeDecoder
func NewAES ¶
func NewAES(key []byte, guard int) EncodeDecoder
NewAES creates a new AES encoder/decoder. The aesType must be 0, 16, 24, or 32 to select, if it's 0, no KDF will be used, the key will be used directly.
func NewBase64 ¶
func NewBase64() EncodeDecoder
func NewGzip ¶
func NewGzip() EncodeDecoder
type EncodeDecoderFn ¶
type EncodeDecoderFn struct { E func(io.Writer) (io.WriteCloser, error) D func(io.Reader) (io.ReadCloser, error) }
func (*EncodeDecoderFn) Decoder ¶
func (ed *EncodeDecoderFn) Decoder(r io.Reader) (io.ReadCloser, error)
func (*EncodeDecoderFn) Encoder ¶
func (ed *EncodeDecoderFn) Encoder(w io.Writer) (io.WriteCloser, error)
type Ender ¶ added in v0.1.0
type Ender struct {
// contains filtered or unexported fields
}
Ender acts like a proxy for the a io.ReadWriteCloser. The writer can send EndErrors to the reader. It will use json to marshal the error for the reader.
func NewEnder ¶ added in v0.1.0
func NewEnder(rw io.ReadWriteCloser) *Ender
type ReadEnder ¶ added in v0.1.0
type ReadEnder struct {
// contains filtered or unexported fields
}
func NewReadEnder ¶ added in v0.1.0
type Transformer ¶ added in v0.1.0
type Transformer struct { Transform func() ([]byte, error) // contains filtered or unexported fields }
func NewTransformer ¶ added in v0.1.0
func NewTransformer(t func() ([]byte, error)) *Transformer
type Transparent ¶ added in v0.1.0
type Transparent struct{}
func (*Transparent) Decoder ¶ added in v0.1.0
func (t *Transparent) Decoder(r io.Reader) (io.ReadCloser, error)
func (*Transparent) Encoder ¶ added in v0.1.0
func (t *Transparent) Encoder(w io.Writer) (io.WriteCloser, error)
type WrapReadCloser ¶ added in v0.3.0
func (*WrapReadCloser) Close ¶ added in v0.3.0
func (w *WrapReadCloser) Close() error
type WriteClose ¶ added in v0.0.5
func (WriteClose) Close ¶ added in v0.0.5
func (wc WriteClose) Close() error
type WriteEnder ¶ added in v0.1.0
type WriteEnder struct {
// contains filtered or unexported fields
}
func NewWriteEnder ¶ added in v0.1.0
func NewWriteEnder(w io.WriteCloser) *WriteEnder
func (WriteEnder) Close ¶ added in v0.1.0
func (w WriteEnder) Close() error
func (WriteEnder) End ¶ added in v0.1.0
func (w WriteEnder) End(e error) error
Click to show internal directories.
Click to hide internal directories.