rotating

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B = 1 << (iota * 10)
	KiB
	MiB
	GiB
	TiB

	KB = 1e3
	MB = 1e6
	GB = 1e9
	TB = 1e12
)

Variables

This section is empty.

Functions

func IsPattern

func IsPattern(name string) bool

Types

type File

type File struct {
	MaxFileSize int64
	MaxFileAge  time.Duration

	MaxTotalSize  int64
	MaxTotalAge   time.Duration
	MaxTotalFiles int // including current

	Flags int
	Mode  os.FileMode

	OpenFile FileOpener `deep:"compare=nil"`
	// contains filtered or unexported fields
}

func Create

func Create(name string) (f *File)

func (*File) Close

func (f *File) Close() (err error)

func (*File) Rotate

func (f *File) Rotate() error

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

type FileOpener

type FileOpener = func(name string, flags int, mode os.FileMode) (io.Writer, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳