Documentation
¶
Index ¶
- Constants
- func Dump(p []byte) (r string)
- func SetEncoder(tp interface{}, encoder ValueEncoder)
- type Decoder
- func (d *Decoder) Addr(p []byte, st int) (a netip.Addr, ap netip.AddrPort, i int, err error)
- func (d *Decoder) BigInt(p []byte, st int, x *big.Int) (i int, err error)
- 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) AppendAddr(b []byte, a netip.Addr) []byte
- func (e *Encoder) AppendAddrPort(b []byte, a netip.AddrPort) []byte
- func (e *Encoder) AppendBigInt(b []byte, x *big.Int) []byte
- 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, args ...interface{}) []byte
- func (e *Encoder) AppendFormatf(b []byte, format 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) AppendSemantic(b []byte, l int) []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
- type LowEncoder
- type Reader
- type Tag
- type TlogAppender
- type ValueEncoder
Constants ¶
View Source
const ( Int = cbor.Int Neg = cbor.Neg Bytes = cbor.Bytes String = cbor.String Array = cbor.Array Map = cbor.Map Label = cbor.Label Simple = cbor.Simple Semantic = Label Special = Simple TagMask = cbor.TagMask SubMask = cbor.SubMask TagDetMask = SubMask )
Major types.
View Source
const ( Len1 = cbor.Len1 Len2 = cbor.Len2 Len4 = cbor.Len4 Len8 = cbor.Len8 LenBreak = Break )
Len.
View Source
const ( False = cbor.False True = cbor.True Nil = cbor.Null Undefined = cbor.Undefined Float8 = cbor.Float8 Float16 = cbor.Float16 Float32 = cbor.Float32 Float64 = cbor.Float64 Break = cbor.Break None = cbor.None SelfRef = 10 // self reference Hidden = 11 // passwords, etc. when you want to preserve the key )
Specials.
View Source
const ( Meta = iota Error Time Duration Big Caller NetAddr Hex Embedding LabelTlogBase = 10 SemanticTlogBase = LabelTlogBase )
Semantics.
View Source
const ( MetaMagic = iota MetaVer MetaTlogBase = 8 )
Meta.
View Source
const Magic = "\xc0\x64tlog"
Variables ¶
This section is empty.
Functions ¶
func SetEncoder ¶
func SetEncoder(tp interface{}, encoder ValueEncoder)
Types ¶
type Decoder ¶
type Dumper ¶
type Encoder ¶
func (*Encoder) AppendAddr ¶ added in v0.24.0
func (*Encoder) AppendAddrPort ¶ added in v0.24.0
func (*Encoder) AppendBigInt ¶ added in v0.26.0
func (*Encoder) AppendFormat ¶
func (*Encoder) AppendFormatf ¶ added in v0.26.0
func (*Encoder) AppendKeyInt64 ¶
func (*Encoder) AppendKeyUint64 ¶
func (*Encoder) AppendKeyValue ¶
func (*Encoder) AppendSemantic ¶ added in v0.26.0
func (*Encoder) AppendValue ¶
func (*Encoder) AppendValueSafe ¶
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 LowDecoder ¶
type LowEncoder ¶
func (LowEncoder) AppendSemantic ¶
func (e LowEncoder) AppendSemantic(b []byte, l int) []byte
type TlogAppender ¶
type ValueEncoder ¶
Click to show internal directories.
Click to hide internal directories.