Versions in this module Expand all Collapse all v0 v0.35.0 Nov 20, 2026 v0.34.0 Nov 12, 2026 Changes in this version + var ErrAlreadyClosed = errors.New("writer already closed") + var ErrAttemptToWriteOnClosedFile = errors.New("cannot write to a closed or unopened file") + type Append struct + func NewAppend(w io.Writer, fn WriterAppendFunc) *Append + func (a *Append) Close() error + func (a *Append) Write(data []byte) (int, error) + type Async struct + func NewAsync(handler io.Writer, options ...AsyncOption) *Async + func (w *Async) Close() error + func (w *Async) Flush() error + func (w *Async) Write(data []byte) (n int, err error) + type AsyncOption func(writer *Async) + func WithWriteInterval(duration time.Duration) AsyncOption + type File struct + func NewFile(filename string, options ...FileOption) (f *File, err error) + func (f *File) Close() error + func (f *File) Flush() error + func (f *File) Write(data []byte) (n int, err error) + type FileOption func(f *File) + func WithFileFlag(flag int) FileOption + func WithFileKeepOpen(keepOpen bool) FileOption + func WithFileKeepOpenTimeout(timeout time.Duration) FileOption + func WithFilePerm(perm os.FileMode) FileOption + func WithFileTruncate() FileOption + type WriterAppendFunc func(dst []byte, c byte) []byte