rotated

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B = 1 << (iota * 10)
	KB
	MB
	GB
)

Variables

View Source
var (
	SubstChar  = '@'
	TimeFormat = "2006-01-02_15-04-05.000"
)

Functions

func OpenFileOS added in v0.10.0

func OpenFileOS(n string, f int, mode os.FileMode) (io.Writer, error)

func OpenFileTimeSubst added in v0.10.0

func OpenFileTimeSubst(base string, f int, mode os.FileMode) (w io.Writer, err error)
func OpenFileTimeSubstWithSymlink(base string, f int, mode os.FileMode) (w io.Writer, err error)

Types

type File

type File struct {
	MaxSize int64

	ErrorOnRotate error

	Flags    int
	Mode     os.FileMode
	OpenFile func(name string, flag int, mode os.FileMode) (io.Writer, error)
	// 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 added in v0.4.2

func (f *File) Rotate() error

func (*File) Write

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

type RotatedError added in v0.10.0

type RotatedError struct{}

func (RotatedError) Error added in v0.10.0

func (RotatedError) Error() string

func (RotatedError) IsRotated added in v0.10.0

func (RotatedError) IsRotated() bool

Jump to

Keyboard shortcuts

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