Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultRegistry contains the registered compressors DefaultRegistry = NewMapRegistry().Put("tar", &Tar{}) )
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor interface { Compress(directory files.Directory, writer *bytes.Buffer) (e error) // Decompress decompresses the file paths into the output paths Decompress(reader io.Reader) (dir files.Directory, e error) }
Compressor defines an object that is capable of compressing and decompressing a file
type MapRegistry ¶
type MapRegistry struct {
// contains filtered or unexported fields
}
MapRegistry is a map based compressor registry
func NewMapRegistry ¶
func NewMapRegistry() *MapRegistry
NewMapRegistry creates a new instance of the map registry
func (*MapRegistry) Find ¶
func (r *MapRegistry) Find(id string) (compressor Compressor)
Find returns the found compressor instance for the given id, or nil if non was found
func (*MapRegistry) Put ¶
func (r *MapRegistry) Put(id string, compressor Compressor) Registry
Put stores a new compressor instance for the given id in the registry
type Registry ¶
type Registry interface { Put(id string, compressor Compressor) Registry Find(id string) (compressor Compressor) }
Registry contains a collection of Compressor instances that can be used to compress files
Put stores a new compressor instance in the registry for the given id ¶
Find returns the compressor that is registered for the given id or nil if non was found
Click to show internal directories.
Click to hide internal directories.