Documentation
¶
Index ¶
- Variables
- func DefaultProcessor(r Row, e error) error
- func LcFirst(str string) string
- func NoFailureProcessor(r Row, e error) error
- type Exporter
- type Format
- type Importer
- type Processor
- type RawType
- type Row
- type Streamer
- type Template
- type Value
- func CloneValue(v Value) Value
- func NewValue(v interface{}, f Format, rawtype RawType) Value
- func NewValueAuto(v interface{}) Value
- func NewValueBinary(v interface{}) Value
- func NewValueBoolean(v interface{}) Value
- func NewValueDate(v interface{}) Value
- func NewValueDateTime(v interface{}) Value
- func NewValueHidden(v interface{}) Value
- func NewValueNil(f Format, rawtype RawType) Value
- func NewValueNumeric(v interface{}) Value
- func NewValueString(v interface{}) Value
- func NewValueTimestamp(v interface{}) Value
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DefaultProcessor ¶
func NoFailureProcessor ¶
Types ¶
type Exporter ¶
func NewExporter ¶
type Format ¶
type Format int8
const ( String Format = iota // String representation, e.g. : "hello", "2.4", "true". Numeric // Numeric (integer or decimal), e.g. : 2.4, 1. Boolean // Boolean : true or false. Binary // Binary representation encoded as base64. Date // Date without zone info, e.g. : "2006-01-02". DateTime // DateTime as RFC3339, e.g. : "2006-01-02T15:04:05Z", "2006-01-02T15:04:05+07:00". Timestamp // Timestamp the number of seconds since 1970 ("UNIX time"). Auto // Auto columns have no specific format enforced. Hidden // Hidden columns will not be exported in jsonline. )
type Importer ¶
type Importer interface {
WithTemplate(Template) Importer
Import() bool
GetRow() (Row, error)
ReadOne() (Row, error)
}
func NewImporter ¶
type Row ¶
type Row interface {
Value
Has(key string) bool
Get(key string) (interface{}, bool)
GetOrNil(key string) interface{}
GetAtIndex(index int) (interface{}, bool)
GetAtIndexOrNil(index int) interface{}
GetAtPath(path string) (interface{}, bool)
GetAtPathOrNil(path string) interface{}
Set(key string, val interface{})
SetAtIndex(index int, val interface{})
Len() int
Iter() func() (string, interface{}, bool)
GetString(key string) string
GetInt(key string) int
GetInt64(key string) int64
GetInt32(key string) int32
GetInt16(key string) int16
GetInt8(key string) int8
GetUint(key string) uint
GetUint64(key string) uint64
GetUint32(key string) uint32
GetUint16(key string) uint16
GetUint8(key string) uint8
GetFloat64(key string) float64
GetFloat32(key string) float32
GetBool(key string) bool
GetBytes(key string) []byte
GetTime(key string) time.Time
ImportAtKey(key string, val interface{}) error
ImportAtIndex(index int, val interface{}) error
ImportAtPath(path string, val interface{}) error
GetValue(key string) (Value, bool)
GetValueAtIndex(index int) (Value, bool)
GetValueAtPath(path string) (Value, bool)
FindValuesAtPath(path string) ([]Value, bool)
SetValue(key string, val Value) Row
SetValueAtIndex(index int, val Value) Row
IterValues() func() (string, Value, bool)
MapTo(interface{})
}
type Streamer ¶
func NewStreamer ¶
type Template ¶
type Template interface {
WithString(name string) Template
WithNumeric(name string) Template
WithBoolean(name string) Template
WithBinary(name string) Template
WithDate(name string) Template
WithDateTime(name string) Template
WithTimestamp(name string) Template
WithAuto(name string) Template
WithHidden(name string) Template
WithRow(name string, row Template) Template
WithMappedString(name string, rawtype RawType) Template
WithMappedNumeric(name string, rawtype RawType) Template
WithMappedBoolean(name string, rawtype RawType) Template
WithMappedBinary(name string, rawtype RawType) Template
WithMappedDate(name string, rawtype RawType) Template
WithMappedDateTime(name string, rawtype RawType) Template
WithMappedTimestamp(name string, rawtype RawType) Template
WithMappedAuto(name string, rawtype RawType) Template
With(name string, format Format, rawtype RawType) Template
CreateRow(interface{}) (Row, error)
CreateRowEmpty() Row
GetExporter(io.Writer) Exporter
GetImporter(io.Reader) Importer
}
func NewTemplate ¶
func NewTemplate() Template
type Value ¶
type Value interface {
GetFormat() Format
GetRawType() RawType
Raw() interface{}
Export() (interface{}, error)
Import(interface{}) error
ExportOrNil() interface{}
json.Unmarshaler
json.Marshaler
fmt.Stringer
DebugString() string
}
func CloneValue ¶
func NewValueAuto ¶
func NewValueAuto(v interface{}) Value
func NewValueBinary ¶
func NewValueBinary(v interface{}) Value
func NewValueBoolean ¶
func NewValueBoolean(v interface{}) Value
func NewValueDate ¶ added in v0.5.0
func NewValueDate(v interface{}) Value
func NewValueDateTime ¶
func NewValueDateTime(v interface{}) Value
func NewValueHidden ¶
func NewValueHidden(v interface{}) Value
func NewValueNil ¶
func NewValueNumeric ¶
func NewValueNumeric(v interface{}) Value
func NewValueString ¶
func NewValueString(v interface{}) Value
func NewValueTimestamp ¶
func NewValueTimestamp(v interface{}) Value
Click to show internal directories.
Click to hide internal directories.