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 Reader
- type Reference
- type StringifyConfig
- type Tag
- type UnmarshalSession
- type XMLMarhsaler
Constants ¶
View Source
const (
TagName = "xmlify"
)
Variables ¶
This section is empty.
Functions ¶
func EscapeSpecialChars ¶
Types ¶
type Accessor ¶
type Accessor struct {
// contains filtered or unexported fields
}
func (*Accessor) Interfacer ¶
func (*Accessor) RegularHeaders ¶
func (*Accessor) ResetAllChildren ¶
func (a *Accessor) ResetAllChildren()
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer represents itemBuffer
type Config ¶
type Config struct { Style string // TODO MFI delete style // TODO MFI move below to another config RootTag string HeaderTag string HeaderRowTag string HeaderRowFieldAttr string HeaderRowFieldTypeAttr string HeaderRowFieldType map[string]string DataTag string DataRowTag string DataRowFieldTag string DataRowFieldTypes map[string]string TabularNullValue string NewLineSeparator string //// RegularRootTag string RegularRowTag string RegularNullValue string // TODO map of types for header and data FieldSeparator string ObjectSeparator string EncloseBy string EscapeBy string NullValue string Stringify StringifyConfig UniqueFields []string References []*Reference // parent -> children. Example02.ID -> Boo.FooId ExcludedPaths []string StringifierConfig io.StringifierConfig // contains filtered or unexported fields }
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{}]setMarker
func (ObjectIndex) Index ¶
func (i ObjectIndex) Index(value interface{}) setMarker
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 Tag ¶
type Tag struct { format.Tag Path string Tabular bool OmitTagName bool Cdata bool NullifyEmpty bool }
Tag represent field tag
type UnmarshalSession ¶
type UnmarshalSession struct {
// contains filtered or unexported fields
}
type XMLMarhsaler ¶
Click to show internal directories.
Click to hide internal directories.