piper

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAESDecode = errors.New("wrong secret or corrupted data")

Functions

func Close added in v0.0.5

func Close(stream interface{}) error

Types

type AES

type AES struct {
	Key []byte
}

func (*AES) Decoder

func (a *AES) Decoder(r io.Reader) (io.ReadCloser, error)

func (*AES) Encoder

func (a *AES) Encoder(w io.Writer) (io.WriteCloser, error)

type Base64

type Base64 struct {
	Encoding *base64.Encoding
}

func (*Base64) Decoder

func (e *Base64) Decoder(r io.Reader) (io.ReadCloser, error)

func (*Base64) Encoder

func (e *Base64) Encoder(w io.Writer) (io.WriteCloser, error)

type Buffer added in v0.0.5

type Buffer []byte

func (*Buffer) Consume added in v0.0.5

func (b *Buffer) Consume(dst []byte) int

Consume consumes the buffer to dst and returns the number of bytes consumed.

type EncodeDecoder

type EncodeDecoder interface {
	Encoder(io.Writer) (io.WriteCloser, error)
	Decoder(io.Reader) (io.ReadCloser, error)
}

func Join

func Join(list ...EncodeDecoder) EncodeDecoder

func NewAES

func NewAES(key []byte) EncodeDecoder

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 Gzip

type Gzip struct {
	Level int
}

func (*Gzip) Decoder

func (g *Gzip) Decoder(r io.Reader) (io.ReadCloser, error)

func (*Gzip) Encoder

func (g *Gzip) Encoder(w io.Writer) (io.WriteCloser, error)

type ReadClose added in v0.0.5

type ReadClose struct {
	R func(p []byte) (n int, err error)
	C func() error
}

func (ReadClose) Close added in v0.0.5

func (rc ReadClose) Close() error

func (ReadClose) Read added in v0.0.5

func (rc ReadClose) Read(p []byte) (n int, err error)

type WriteClose added in v0.0.5

type WriteClose struct {
	W func(p []byte) (n int, err error)
	C func() error
}

func (WriteClose) Close added in v0.0.5

func (wc WriteClose) Close() error

func (WriteClose) Write added in v0.0.5

func (wc WriteClose) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL