binary

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package binary provides a binary format for structured logging with slog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader, v DecodeVisitor) error

func PutEncoder

func PutEncoder(e *Encoder)

Types

type DecodeVisitor

type DecodeVisitor interface {
	Int(key []byte, val int64)
	Uint(key []byte, val uint64)
	String(key, val []byte)
	Bytes(key, val []byte)
	Bool(key []byte, val bool)
	Float(key []byte, val float64)
	Duration(key []byte, val time.Duration)
	Time(key []byte, val time.Time)
	Group(n int)
}

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func GetEncoder

func GetEncoder() *Encoder

func (*Encoder) EncodeKey

func (e *Encoder) EncodeKey(key string)

func (*Encoder) EncodeValue

func (e *Encoder) EncodeValue(v slog.Value)

func (*Encoder) WriteTo

func (e *Encoder) WriteTo(w io.Writer) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL