type Buffer … // NewBuffer creates a new buffer of a given size. The size // must be greater than 0. func NewBuffer(size int64) (*Buffer, error) { … } // Write writes up to len(buf) bytes to the internal ring, // overriding older data if necessary. func (b *Buffer) Write(buf []byte) (int, error) { … } // Size returns the size of the buffer func (b *Buffer) Size() int64 { … } // TotalWritten provides the total number of bytes written func (b *Buffer) TotalWritten() int64 { … } // Bytes provides a slice of the bytes written. This // slice should not be written to. func (b *Buffer) Bytes() []byte { … } // Reset resets the buffer so it has no content. func (b *Buffer) Reset() { … } // String returns the contents of the buffer as a string func (b *Buffer) String() string { … }