Documentation ¶
Index ¶
- func Apply(loaders ...Loader) error
- func PathKeyMaker(s []string, tag *reflect.StructTag) (string, error)
- func PrintFieldsWithTemplate(m *MetaData, w io.Writer, t string, fmap map[string]interface{}) (err error)
- func TagKeyMaker(tagName string, autoNaming bool) func([]string, *reflect.StructTag) (string, error)
- type Converter
- type Converters
- type DurationConverter
- type Loader
- type MetaData
- func (m *MetaData) AddConverters(converters ...Converter) *MetaData
- func (m *MetaData) GetField(key string) *MetaDataField
- func (m *MetaData) GetFields() []MetaDataField
- func (m *MetaData) GetKeys() []string
- func (m *MetaData) GetObject() interface{}
- func (m *MetaData) SetFieldValue(key string, value string) error
- type MetaDataField
- type Options
- type TextMarshallerConverter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathKeyMaker ¶
PathKeyMaker joins names of struct fields with dot character.
func PrintFieldsWithTemplate ¶
Types ¶
type Converters ¶
type Converters []Converter
func (Converters) Append ¶
func (c Converters) Append(cs ...Converter) Converters
func (Converters) ConvertToString ¶
func (Converters) LoadFromString ¶
type DurationConverter ¶
type DurationConverter struct{}
func (DurationConverter) StoreString ¶
func (_ DurationConverter) StoreString(value reflect.Value, s string) error
type MetaData ¶
type MetaData struct {
// contains filtered or unexported fields
}
func NewMetadata ¶
func (*MetaData) AddConverters ¶
func (*MetaData) GetField ¶
func (m *MetaData) GetField(key string) *MetaDataField
func (*MetaData) GetFields ¶
func (m *MetaData) GetFields() []MetaDataField
type MetaDataField ¶
type MetaDataField struct {
// contains filtered or unexported fields
}
func (*MetaDataField) FullKey ¶
func (f *MetaDataField) FullKey() string
func (*MetaDataField) IsNil ¶
func (f *MetaDataField) IsNil() bool
func (*MetaDataField) Key ¶
func (f *MetaDataField) Key() string
func (*MetaDataField) StringValue ¶
func (f *MetaDataField) StringValue() string
func (*MetaDataField) Tag ¶
func (f *MetaDataField) Tag(key string) string
func (*MetaDataField) Type ¶
func (f *MetaDataField) Type() reflect.Type
func (*MetaDataField) Value ¶
func (f *MetaDataField) Value() interface{}
type Options ¶
type Options struct { // Generates key which will be used for fields lookup KeyMakerFunc func([]string, *reflect.StructTag) (string, error) // If set to true, sub structures can be defined using string representation. // The format of string is defined by ComplexFieldsUnmarshaler AllowParsingSubStructures bool // Function which will unmarshal sub structures, slice or maps. ComplexFieldsUnmarshaler func([]byte, interface{}) error // Function which will marshal sub structures, slices or maps. // Usually is used for string representations. ComplexFieldsMarshaler func(interface{}) ([]byte, error) Loggerf func(string, ...interface{}) // If true, maps will be owerwritten by making new map, // In opposite case they will be updated OverwriteMaps bool }
type TextMarshallerConverter ¶
type TextMarshallerConverter struct{}
func (TextMarshallerConverter) Applies ¶
func (TextMarshallerConverter) Applies(value reflect.Value) bool
func (TextMarshallerConverter) StoreString ¶
func (TextMarshallerConverter) StoreString(value reflect.Value, s string) error
Click to show internal directories.
Click to hide internal directories.