func (d *treeStorageDriverInstance) compressExtension() string {
	if d.compressmethod == compressMethodGzip {
		return ".gz"
	} else if d.compressmethod == compressMethodZlib {
		return ".xz"
	}
	return ""
}
compressExtension returns the file extension to be used for the configured compression method
package storage
import (
	"compress/gzip"
	"compress/zlib"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path"
	"github.com/pkg/errors"
	"github.com/repoSpanner/repoSpanner/server/utils"
)
type compressMethod int
const (
	compressMethodNone compressMethod = 0
	compressMethodGzip                = 1
	compressMethodZlib                = 2
)
type treeStorageDriverInstance struct {
	dirname        string
	compressmethod compressMethod
}
func newTreeStoreDriver(dir, comp string) (*treeStorageDriverInstance, error) {
	inst := &treeStorageDriverInstance{dirname: dir}
	if comp == "none" {
		inst.compressmethod = compressMethodNone
	} else if comp == "gzip" {
		inst.compressmethod = compressMethodGzip
	} else if comp == "zlib" {
		inst.compressmethod = compressMethodZlib
	} else {
		return nil, errors.Errorf("Invalid compressiong method %s", comp)
	}
	return inst, nil
}
type nopWriter struct{ w io.Writer }
func (w *nopWriter) Write(buf []byte) (int, error) {
	return w.w.Write(buf)
}
func (w *nopWriter) Close() error {
	return nil
}