strictcsv

package
v1.119.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error is an error class for the package.
	Error = errs.Class("strictcsv")
)

Functions

func Marshal

func Marshal(obj interface{}) ([]byte, error)

Marshal marshals an object into CSV and returns the bytes.

func MarshalString

func MarshalString(obj interface{}) (string, error)

MarshalString marshals an object into CSV and returns a string.

func Read

func Read(r io.Reader, obj interface{}) error

Read unmarshals an object from a CSV reader.

func Unmarshal

func Unmarshal(b []byte, obj interface{}) error

Unmarshal unmarshals an object from CSV bytes.

func UnmarshalString

func UnmarshalString(s string, obj interface{}) error

UnmarshalString unmarshals an object from a CSV string.

func Write

func Write(w io.Writer, obj interface{}) error

Write marshals an object into CSV and writes it to the writer.

Types

type Marshaler

type Marshaler interface {
	MarshalCSV() (string, error)
}

Marshaler is used to implement customized CSV field marshaling.

type Unmarshaler

type Unmarshaler interface {
	UnmarshalCSV(s string) error
}

Unmarshaler is used to implement customized CSV field unmarshaling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL