2022-10-31 15:52:21 +00:00
|
|
|
package toml
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
2024-05-15 23:15:00 +00:00
|
|
|
// TextMarshaler is an alias for encoding.TextMarshaler.
|
|
|
|
//
|
2022-10-31 15:52:21 +00:00
|
|
|
// Deprecated: use encoding.TextMarshaler
|
|
|
|
type TextMarshaler encoding.TextMarshaler
|
|
|
|
|
2024-05-15 23:15:00 +00:00
|
|
|
// TextUnmarshaler is an alias for encoding.TextUnmarshaler.
|
|
|
|
//
|
2022-10-31 15:52:21 +00:00
|
|
|
// Deprecated: use encoding.TextUnmarshaler
|
|
|
|
type TextUnmarshaler encoding.TextUnmarshaler
|
|
|
|
|
2024-05-15 23:15:00 +00:00
|
|
|
// PrimitiveDecode is an alias for MetaData.PrimitiveDecode().
|
|
|
|
//
|
2022-10-31 15:52:21 +00:00
|
|
|
// Deprecated: use MetaData.PrimitiveDecode.
|
|
|
|
func PrimitiveDecode(primValue Primitive, v interface{}) error {
|
|
|
|
md := MetaData{decoded: make(map[string]struct{})}
|
|
|
|
return md.unify(primValue.undecoded, rvalue(v))
|
|
|
|
}
|
|
|
|
|
2024-05-15 23:15:00 +00:00
|
|
|
// DecodeReader is an alias for NewDecoder(r).Decode(v).
|
|
|
|
//
|
2022-10-31 15:52:21 +00:00
|
|
|
// Deprecated: use NewDecoder(reader).Decode(&value).
|
|
|
|
func DecodeReader(r io.Reader, v interface{}) (MetaData, error) { return NewDecoder(r).Decode(v) }
|