Documentation
¶
Index ¶
- Constants
- func Dump(p []byte) (r string)
- func SetEncoder(tp interface{}, encoder ValueEncoder)
- type Decoder
- func (d Decoder) Caller(p []byte, st int) (pc loc.PC, i int)
- func (d Decoder) Callers(p []byte, st int) (pc loc.PC, pcs loc.PCs, i int)
- func (d Decoder) Duration(p []byte, st int) (dr time.Duration, i int)
- func (d Decoder) Time(p []byte, st int) (t time.Time, i int)
- func (d Decoder) Timestamp(p []byte, st int) (ts int64, i int)
- type Dumper
- type Encoder
- func (e Encoder) AppendCaller(b []byte, pc loc.PC) []byte
- func (e Encoder) AppendCallers(b []byte, pcs loc.PCs) []byte
- func (e Encoder) AppendDuration(b []byte, d time.Duration) []byte
- func (e Encoder) AppendError(b []byte, err error) []byte
- func (e Encoder) AppendFormat(b []byte, fmt string, args ...interface{}) []byte
- func (e Encoder) AppendKey(b []byte, key string) []byte
- func (e Encoder) AppendKeyInt(b []byte, k string, v int) []byte
- func (e Encoder) AppendKeyInt64(b []byte, k string, v int64) []byte
- func (e Encoder) AppendKeyString(b []byte, k, v string) []byte
- func (e Encoder) AppendKeyUint(b []byte, k string, v uint) []byte
- func (e Encoder) AppendKeyUint64(b []byte, k string, v uint64) []byte
- func (e *Encoder) AppendKeyValue(b []byte, key string, v interface{}) []byte
- func (e Encoder) AppendPC(b []byte, pc loc.PC) []byte
- func (e Encoder) AppendPCs(b []byte, pcs loc.PCs) []byte
- func (e Encoder) AppendTime(b []byte, t time.Time) []byte
- func (e Encoder) AppendTimeMonoTZ(b []byte, t time.Time) []byte
- func (e Encoder) AppendTimeTZ(b []byte, t time.Time) []byte
- func (e Encoder) AppendTimestamp(b []byte, t int64) []byte
- func (e *Encoder) AppendValue(b []byte, v interface{}) []byte
- func (e *Encoder) AppendValueSafe(b []byte, v interface{}) []byte
- func (e Encoder) InsertLen(b []byte, st, l int) []byte
- func (e *Encoder) SetEncoder(tp interface{}, encoder ValueEncoder)
- type LowDecoder
- func (d LowDecoder) Break(b []byte, i *int) bool
- func (d LowDecoder) Bytes(b []byte, st int) (v []byte, i int)
- func (d LowDecoder) Float(b []byte, st int) (v float64, i int)
- func (d LowDecoder) Signed(b []byte, st int) (v int64, i int)
- func (d LowDecoder) Skip(b []byte, st int) (i int)
- func (d LowDecoder) SkipTag(b []byte, st int) (tag byte, sub int64, i int)
- func (d LowDecoder) Tag(b []byte, st int) (tag byte, sub int64, i int)
- func (d LowDecoder) TagOnly(b []byte, st int) (tag byte)
- func (d LowDecoder) Unsigned(b []byte, st int) (v uint64, i int)
- type LowEncoder
- func (e LowEncoder) AppendArray(b []byte, l int) []byte
- func (e LowEncoder) AppendBool(b []byte, v bool) []byte
- func (e LowEncoder) AppendBreak(b []byte) []byte
- func (e LowEncoder) AppendBytes(b, s []byte) []byte
- func (e LowEncoder) AppendFloat(b []byte, v float64) []byte
- func (e LowEncoder) AppendInt(b []byte, v int) []byte
- func (e LowEncoder) AppendInt64(b []byte, v int64) []byte
- func (e LowEncoder) AppendMap(b []byte, l int) []byte
- func (e LowEncoder) AppendNil(b []byte) []byte
- func (e LowEncoder) AppendNone(b []byte) []byte
- func (e LowEncoder) AppendSemantic(b []byte, x int) []byte
- func (e LowEncoder) AppendSpecial(b []byte, x byte) []byte
- func (e LowEncoder) AppendString(b []byte, s string) []byte
- func (e LowEncoder) AppendTag(b []byte, tag byte, v int) []byte
- func (e LowEncoder) AppendTag64(b []byte, tag byte, v uint64) []byte
- func (e LowEncoder) AppendTagBreak(b []byte, tag byte) []byte
- func (e LowEncoder) AppendTagBytes(b []byte, tag byte, s []byte) []byte
- func (e LowEncoder) AppendTagString(b []byte, tag byte, s string) []byte
- func (e LowEncoder) AppendUint(b []byte, v uint) []byte
- func (e LowEncoder) AppendUint64(b []byte, v uint64) []byte
- func (e LowEncoder) AppendUndefined(b []byte) []byte
- func (e LowEncoder) Tag64Size(v uint64) int
- func (e LowEncoder) TagSize(v int) int
- type StreamDecoder
- type TlogAppender
- type ValueEncoder
Constants ¶
View Source
const ( Int = iota << 5 Neg Bytes String Array Map Semantic Special TagMask = 0b111_00000 TagDetMask = 0b000_11111 )
Basic types.
View Source
const ( Len1 = 24 + iota Len2 Len4 Len8 LenBreak = Break )
Len.
View Source
const ( None = 19 + iota False True Nil Undefined Float8 Float16 Float32 Float64 Break )
Specials.
View Source
const ( Meta = iota Error Time Duration Big Caller Hex SemanticTlogBase )
Semantics.
Variables ¶
This section is empty.
Functions ¶
func SetEncoder ¶
func SetEncoder(tp interface{}, encoder ValueEncoder)
Types ¶
type Decoder ¶
type Decoder struct {
LowDecoder
}
type Dumper ¶
type Dumper struct {
LowDecoder
io.Writer
NoGlobalOffset bool
// contains filtered or unexported fields
}
type Encoder ¶
type Encoder struct {
LowEncoder
// contains filtered or unexported fields
}
func (Encoder) AppendFormat ¶
func (Encoder) AppendKeyUint64 ¶
func (*Encoder) AppendKeyValue ¶ added in v0.21.0
func (Encoder) AppendTimeMonoTZ ¶ added in v0.21.2
func (*Encoder) AppendValue ¶
func (*Encoder) AppendValueSafe ¶ added in v0.21.0
func (Encoder) InsertLen ¶
InsertLen inserts length l before value starting at st copying l bytes forward if needed. It is created for AppendFormat because we don't know the final message length. But it can be also used in other similar situations.
func (*Encoder) SetEncoder ¶
func (e *Encoder) SetEncoder(tp interface{}, encoder ValueEncoder)
type LowEncoder ¶
type LowEncoder struct{}
func (LowEncoder) AppendArray ¶
func (e LowEncoder) AppendArray(b []byte, l int) []byte
func (LowEncoder) AppendBool ¶
func (e LowEncoder) AppendBool(b []byte, v bool) []byte
func (LowEncoder) AppendBreak ¶
func (e LowEncoder) AppendBreak(b []byte) []byte
func (LowEncoder) AppendBytes ¶
func (e LowEncoder) AppendBytes(b, s []byte) []byte
func (LowEncoder) AppendFloat ¶
func (e LowEncoder) AppendFloat(b []byte, v float64) []byte
func (LowEncoder) AppendInt64 ¶
func (e LowEncoder) AppendInt64(b []byte, v int64) []byte
func (LowEncoder) AppendNil ¶
func (e LowEncoder) AppendNil(b []byte) []byte
func (LowEncoder) AppendNone ¶
func (e LowEncoder) AppendNone(b []byte) []byte
func (LowEncoder) AppendSemantic ¶
func (e LowEncoder) AppendSemantic(b []byte, x int) []byte
func (LowEncoder) AppendSpecial ¶
func (e LowEncoder) AppendSpecial(b []byte, x byte) []byte
func (LowEncoder) AppendString ¶
func (e LowEncoder) AppendString(b []byte, s string) []byte
func (LowEncoder) AppendTag64 ¶
func (e LowEncoder) AppendTag64(b []byte, tag byte, v uint64) []byte
func (LowEncoder) AppendTagBreak ¶
func (e LowEncoder) AppendTagBreak(b []byte, tag byte) []byte
func (LowEncoder) AppendTagBytes ¶
func (e LowEncoder) AppendTagBytes(b []byte, tag byte, s []byte) []byte
func (LowEncoder) AppendTagString ¶
func (e LowEncoder) AppendTagString(b []byte, tag byte, s string) []byte
func (LowEncoder) AppendUint ¶
func (e LowEncoder) AppendUint(b []byte, v uint) []byte
func (LowEncoder) AppendUint64 ¶
func (e LowEncoder) AppendUint64(b []byte, v uint64) []byte
func (LowEncoder) AppendUndefined ¶
func (e LowEncoder) AppendUndefined(b []byte) []byte
func (LowEncoder) Tag64Size ¶
func (e LowEncoder) Tag64Size(v uint64) int
func (LowEncoder) TagSize ¶
func (e LowEncoder) TagSize(v int) int
type StreamDecoder ¶
func NewStreamDecoder ¶
func NewStreamDecoder(r io.Reader) *StreamDecoder
func (*StreamDecoder) Decode ¶
func (d *StreamDecoder) Decode() (data []byte, err error)
type TlogAppender ¶
type ValueEncoder ¶
Click to show internal directories.
Click to hide internal directories.