func (c *Compression) Value() CompAlgo {
	return c.CompAlgo
}
Value return time.Duration value
package config
import (
	"fmt"
	"github.com/BurntSushi/toml"
)
type CompAlgo int
const (
	CompAlgoNone CompAlgo = iota
	CompAlgoLZ4
)
var compressionMap = map[string]CompAlgo{
	"none": CompAlgoNone,
	"lz4":  CompAlgoLZ4,
}
var compressionMapReversed = map[CompAlgo]string{}
func init() {
	for k, v := range compressionMap {
		compressionMapReversed[v] = k
	}
}
type Compression struct {
	CompAlgo
}
var _ toml.TextMarshaler = &Compression{}
func (c *Compression) UnmarshalText(text []byte) (err error) {
	t := string(text)
	algo, ok := compressionMap[t]
	if !ok {
		return fmt.Errorf("Compression algorithm '%s' not supported", t)
	}
	c.CompAlgo = algo
	return
}
func (c *Compression) MarshalText() ([]byte, error) {
	return []byte(compressionMapReversed[c.CompAlgo]), nil
}