nix-amer/internal/cnf/parser/common.go

24 lines
421 B
Go
Raw Normal View History

package parser
import (
"io"
)
// Decoder is the common interface shared by parsers
// cf. encoding/json, etc
type Decoder interface {
Decode(interface{}) error
}
// Encoder is the common interface shared by parsers
// cf. encoding/json, etc
type Encoder interface {
Encode(interface{}) error
}
// T is the common parser interface
type T interface {
NewDecoder(io.Reader) Decoder
NewEncoder(io.Writer) Decoder
}