Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRegister = NewRegistry()
DefaultRegister is a Registry which used as default in this package.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder provides LTSV doc decoding.
func NewDecoderWithRegistry ¶
NewDecoderWithRegistry creates a new decoder with Registry.
type Doc ¶
type Doc interface {
Marshaler
Unmarshaler
}
Doc defines required functions for LTSV marshal/unmarshal-able type.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes Marshalers as LTSV lines.
func NewEncoder ¶
NewEncoder cerates a new Encoder using io.Writer.
func NewEncoderWithRegistry ¶
NewEncoderWithRegistry creates a new Encoder with Registry.
type LabelValue ¶
type LabelValue struct {
Label string
Value interface{}
}
LabelValue is a pair of label and value.
func NewLabelValue ¶
func NewLabelValue(label string, value interface{}) *LabelValue
NewLabelValue creates a labeled value.
func (LabelValue) ValueString ¶
func (v LabelValue) ValueString() string
ValueString get a string representation of value.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads LTSV values.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a regisry of LTSV marshal/unmarshal-able types.
type Unmarshaler ¶
Unmarshaler defines LTSV marshaler
func DecodeAll ¶
func DecodeAll(b []byte) ([]Unmarshaler, error)
DecodeAll decodes all unmarshalers from []byte.