Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidKind = errors.New("invalid kind")
ErrInvalidKind for compressor.
View Source
var Module = fx.Options( fx.Provide(NewSnappy), fx.Provide(NewFactory), )
Module for fx.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor interface { // Compress data. Compress(data []byte) []byte // Decompress data. Decompress(data []byte) ([]byte, error) }
Compressor allows to have different ways to compress/decompress.
type Factory ¶ added in v1.156.0
type Factory struct {
// contains filtered or unexported fields
}
Factory of compressor.
func (*Factory) Create ¶ added in v1.156.0
func (f *Factory) Create(kind string) (Compressor, error)
Create from kind.
func (*Factory) Register ¶ added in v1.156.0
func (f *Factory) Register(kind string, c Compressor)
Register kind and compressor.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.