Documentation
¶
Index ¶
- Variables
- func CreateFile(filename string) (*os.File, error)
- type Clock
- type FileRotator
- type Option
- func WithClock(clock Clock) Option
- func WithMaxAge(maxAge time.Duration) Option
- func WithMaxBackup(maxBackup uint) Option
- func WithRotateType(rotateType RotateType) Option
- func WithRotationSize(rotationSize int64) Option
- func WithRotationTime(rotationTime time.Duration) Option
- func WithSymlink(symlink string) Option
- type RotateType
Constants ¶
This section is empty.
Variables ¶
View Source
var Local = clockFn(func() time.Time { return time.Now() })
View Source
var UTC = clockFn(func() time.Time { return time.Now().UTC() })
Functions ¶
Types ¶
type FileRotator ¶
type FileRotator struct {
// contains filtered or unexported fields
}
func (*FileRotator) Close ¶
func (rotator *FileRotator) Close() error
func (*FileRotator) Rotate ¶
func (rotator *FileRotator) Rotate(filename string) error
type Option ¶
type Option func(*FileRotator)
func WithMaxAge ¶
func WithMaxBackup ¶
func WithRotateType ¶
func WithRotateType(rotateType RotateType) Option
func WithRotationSize ¶
func WithRotationTime ¶
func WithSymlink ¶
type RotateType ¶
type RotateType uint8
const ( RotateTypeTime RotateType = iota RotateTypeSize RotateTypeBoth )
func ParseRotationType ¶
func ParseRotationType(s string) RotateType
Click to show internal directories.
Click to hide internal directories.