35 lines
544 B
Go
35 lines
544 B
Go
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
|
|
|
package resource
|
|
|
|
import (
|
|
"encoding/json"
|
|
_ "fmt"
|
|
_ "github.com/xeipuuv/gojsonschema"
|
|
"gopkg.in/yaml.v3"
|
|
"io"
|
|
_ "log"
|
|
)
|
|
|
|
//type JSONDecoder json.Decoder
|
|
|
|
type Decoder interface {
|
|
Decode(v any) error
|
|
}
|
|
|
|
func NewDecoder() *Decoder {
|
|
return nil
|
|
}
|
|
|
|
func NewJSONDecoder(r io.Reader) Decoder {
|
|
return json.NewDecoder(r)
|
|
}
|
|
|
|
func NewYAMLDecoder(r io.Reader) Decoder {
|
|
return yaml.NewDecoder(r)
|
|
}
|
|
|
|
func NewProtoBufDecoder(r io.Reader) Decoder {
|
|
return nil
|
|
}
|