package buffer
Import Path
go.uber.org/zap/buffer (on go.dev)
Dependency Relation
imports 3 packages, and imported by 3 packages
Involved Source Files
Package buffer provides a thin wrapper around a byte slice. Unlike the
standard library's bytes.Buffer, it supports a portion of the strconv
package's zero-allocation formatters.
pool.go
Package-Level Type Names (total 2)
Buffer is a thin wrapper around a byte slice. It's intended to be pooled, so
the only way to construct one is via a Pool.
AppendBool appends a bool to the underlying buffer.
AppendByte writes a single byte to the Buffer.
AppendBytes writes a single byte to the Buffer.
AppendFloat appends a float to the underlying buffer. It doesn't quote NaN
or +/- Inf.
AppendInt appends an integer to the underlying buffer (assuming base 10).
AppendString writes a string to the Buffer.
AppendTime appends the time formatted using the specified layout.
AppendUint appends an unsigned integer to the underlying buffer (assuming
base 10).
Bytes returns a mutable reference to the underlying byte slice.
Cap returns the capacity of the underlying byte slice.
Free returns the Buffer to its Pool.
Callers must not retain references to the Buffer after calling Free.
Len returns the length of the underlying byte slice.
Reset resets the underlying byte slice. Subsequent writes re-use the slice's
backing array.
String returns a string copy of the underlying byte slice.
TrimNewline trims any final "\n" byte from the end of the buffer.
Write implements io.Writer.
WriteByte writes a single byte to the Buffer.
Error returned is always nil, function signature is compatible
with bytes.Buffer and bufio.Writer
WriteString writes a string to the Buffer.
Error returned is always nil, function signature is compatible
with bytes.Buffer and bufio.Writer
*Buffer : fmt.Stringer
*Buffer : github.com/ChrisTrenkamp/goxpath/tree.Result
*Buffer : gorm.io/gorm/clause.Writer
*Buffer : internal/bisect.Writer
*Buffer : io.ByteWriter
*Buffer : io.StringWriter
*Buffer : io.Writer
func Pool.Get() *Buffer
func go.uber.org/zap/zapcore.Encoder.EncodeEntry(zapcore.Entry, []zapcore.Field) (*Buffer, error)
func go.uber.org/zap/internal/stacktrace.NewFormatter(b *Buffer) stacktrace.Formatter
A Pool is a type-safe wrapper around a sync.Pool.
Get retrieves a Buffer from the pool, creating one if necessary.
func NewPool() Pool
Package-Level Functions (only one)
NewPool constructs a new Pool.
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |