Documentation ¶
Index ¶
- Constants
- func Elem(rType reflect.Type) reflect.Type
- func EscapeSpecialChars(value string, config *Config) string
- func WriteObject(writer *Buffer, config *Config, values []string, wasString []bool)
- type Accessor
- type Buffer
- type Config
- type Field
- type Index
- type Marshaller
- type Node
- type NodeIndex
- type Object
- func (o *Object) Accessor(accessorIndex int, mainConfig *Config, depth int, configs []*Config) (*Accessor, error)
- func (o *Object) AddChildren(node Node)
- func (o *Object) AddHolder(field *Field, holder *string)
- func (o *Object) CheckIndexed() (interface{}, bool)
- func (o *Object) Has(parent interface{}, value interface{}) bool
- func (o *Object) ID() interface{}
- func (o *Object) ParentID() interface{}
- func (o *Object) Umarshal() error
- type ObjectIndex
- type PresenceIndex
- type Reader
- type Reference
- type StringifyConfig
- type UnmarshalSession
Constants ¶
View Source
const (
TagName = "csvName"
)
Variables ¶
This section is empty.
Functions ¶
func EscapeSpecialChars ¶
Types ¶
type Accessor ¶
type Accessor struct {
// contains filtered or unexported fields
}
func (*Accessor) Interfacer ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer represents itemBuffer
type Config ¶
type Config struct { FieldSeparator string ObjectSeparator string EncloseBy string EscapeBy string NullValue string Stringify StringifyConfig UniqueFields []string References []*Reference // parent -> children. Foo.ID -> Boo.FooId ExcludedPaths []string StringifierConfig io.StringifierConfig }
Config represents reader config
type Marshaller ¶
type Marshaller struct {
// contains filtered or unexported fields
}
func NewMarshaller ¶
func NewMarshaller(rType reflect.Type, config *Config) (*Marshaller, error)
func (*Marshaller) Marshal ¶
func (m *Marshaller) Marshal(val interface{}, options ...interface{}) ([]byte, error)
func (*Marshaller) ReadHeaders ¶
func (m *Marshaller) ReadHeaders(b []byte) ([]string, error)
func (*Marshaller) Unmarshal ¶
func (m *Marshaller) Unmarshal(b []byte, dest interface{}) error
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func (*Object) AddChildren ¶
func (*Object) CheckIndexed ¶
type ObjectIndex ¶
type ObjectIndex map[interface{}]PresenceIndex
func (ObjectIndex) Index ¶
func (i ObjectIndex) Index(value interface{}) PresenceIndex
type PresenceIndex ¶
type PresenceIndex map[interface{}]bool
func (PresenceIndex) Has ¶
func (p PresenceIndex) Has(value interface{}) bool
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents plain text reader
func NewReader ¶
func NewReader(any interface{}, config *Config, options ...interface{}) (*Reader, reflect.Type, error)
NewReader returns Reader instance and actual data struct type. e.g. data is type of []*Foo - returns Foo.
type StringifyConfig ¶
type StringifyConfig struct { IgnoreFieldSeparator bool IgnoreObjectSeparator bool IgnoreEncloseBy bool }
StringifyConfig "extends" Config with ignore flags
type UnmarshalSession ¶
type UnmarshalSession struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.