rotatewriter

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 9 Imported by: 0

README

rotatewriter

io.Writer with simple file rotation support

Documentation

Index

Constants

View Source
const (
	DefaultMaxSize       = 100
	DefaultMaxBackups    = 7
	DefaultAutoDirCreate = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RotateWriter

type RotateWriter struct {
	Filename      string
	MaxSize       int
	MaxBackups    int
	AutoDirCreate bool
	// contains filtered or unexported fields
}

func New

func New(ops ...WriterOption) (*RotateWriter, error)

func (*RotateWriter) Close

func (w *RotateWriter) Close() error

func (*RotateWriter) Write

func (w *RotateWriter) Write(p []byte) (int, error)

type WriterOption

type WriterOption func(*RotateWriter)

func AutoDirCreate

func AutoDirCreate(auto bool) WriterOption

func Filename

func Filename(name string) WriterOption

func MaxBackups

func MaxBackups(num int) WriterOption

func MaxSize

func MaxSize(size int) WriterOption

Jump to

Keyboard shortcuts

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