Documentation
¶
Index ¶
- Variables
- func DefaultCSVReader(in io.Reader) *csv.Reader
- func DefaultCSVWriter(out io.Writer) *csv.Writer
- func LazyCSVReader(in io.Reader) *csv.Reader
- func Marshal(in interface{}, out io.Writer) (err error)
- func MarshalBytes(in interface{}) (out []byte, err error)
- func MarshalCSV(in interface{}, out *csv.Writer) (err error)
- func MarshalFile(in interface{}, file *os.File) (err error)
- func MarshalString(in interface{}) (out string, err error)
- func SetCSVReader(csvReader func(io.Reader) *csv.Reader)
- func SetCSVWriter(csvWriter func(io.Writer) *csv.Writer)
- func Unmarshal(in io.Reader, out interface{}) (err error)
- func UnmarshalBytes(in []byte, out interface{}) (err error)
- func UnmarshalCSV(in *csv.Reader, out interface{}) error
- func UnmarshalFile(in *os.File, out interface{}) (err error)
- func UnmarshalString(in string, out interface{}) (err error)
- type Decoder
- type Stringer
- type TypeMarshaller
- type TypeUnmarshaller
Constants ¶
This section is empty.
Variables ¶
var FailIfUnmatchedStructTags = false
Functions ¶
func DefaultCSVReader ¶
DefaultCSVReader is the default CSV reader used to parse CSV (cf. csv.NewReader)
func DefaultCSVWriter ¶
DefaultCSVWriter is the default CSV writer used to format CSV (cf. csv.NewWriter)
func LazyCSVReader ¶
LazyCSVReader returns a lazy CSV reader, with LazyQuotes and TrimLeadingSpace.
func MarshalBytes ¶
MarshalBytes returns the CSV bytes from the interface.
func MarshalCSV ¶
func MarshalFile ¶
MarshalFile saves the interface as CSV in the file.
func MarshalString ¶
MarshalString returns the CSV string from the interface.
func SetCSVReader ¶
SetCSVReader sets the CSV reader used to parse CSV.
func SetCSVWriter ¶
SetCSVWriter sets the CSV writer used to format CSV.
func UnmarshalBytes ¶
UnmarshalBytes parses the CSV from the bytes in the interface.
func UnmarshalCSV ¶
func UnmarshalFile ¶
UnmarshalFile parses the CSV from the file in the interface.
func UnmarshalString ¶
UnmarshalString parses the CSV from the string in the interface.
Types ¶
type Stringer ¶
type Stringer interface {
String() string
}
Stringer is implemented by any value that has a String method This converter is used to convert the value to it string representation This converter will be used if your value does not implement TypeMarshaller
type TypeMarshaller ¶
TypeMarshaller is implemented by any value that has a MarshalCSV method This converter is used to convert the value to it string representation
type TypeUnmarshaller ¶
TypeUnmarshaller is implemented by any value that has an UnmarshalCSV method This converter is used to convert a string to your value representation of that string