Documentation ¶
Index ¶
- Constants
- Variables
- func TFormat(t time.Time, fmt string) string
- type Config
- type Control
- type Entries
- type FileHistroyEntry
- type Options
- type RotationDuration
- type Rotator
- func (this *Rotator) AutoRotate(increaseSize int) (entry *FileHistroyEntry, err error)
- func (this *Rotator) Close() (err error)
- func (this *Rotator) Each(cb func(name, info string, finfo os.FileInfo) error) (err error)
- func (this *Rotator) File() *os.File
- func (this *Rotator) History(from, to time.Time, count int64) (events Entries, err error)
- func (this *Rotator) NewName() (name, pth string)
- func (this *Rotator) NewNameT(t time.Time) (name, pth string)
- func (this *Rotator) Open() (f *os.File, err error)
- func (this *Rotator) Rotate() (entry *FileHistroyEntry, err error)
- func (this *Rotator) RotateOptions() Options
- func (this *Rotator) Send(p []byte) (n int, err error)
- func (this *Rotator) Wait()
- func (this *Rotator) Write(p []byte) (n int, err error)
Constants ¶
View Source
const T_FORMAT = "%Y%M%DT%h%m%s%Z"
Variables ¶
View Source
var MaxSize int64 = 1024 * 1024 * 10
Functions ¶
Types ¶
type Config ¶
type Config struct { MaxSize string `yaml:"max_size" mapstructure:"max_size"` Duration string FileMode os.FileMode `yaml:"file_mode" mapstructure:"file_mode"` DirMode os.FileMode `yaml:"dir_mode" mapstructure:"dir_mode"` HistoryDir string `yaml:"history_dir" mapstructure:"history_dir"` HistoryPath string `yaml:"history_path" mapstructure:"history_path"` HistoryCount int `yaml:"history_count" mapstructure:"history_count"` }
type Entries ¶
type Entries []*FileHistroyEntry
type FileHistroyEntry ¶
type FileHistroyEntry struct {
// contains filtered or unexported fields
}
func (*FileHistroyEntry) AbsPath ¶
func (this *FileHistroyEntry) AbsPath() string
func (*FileHistroyEntry) At ¶
func (this *FileHistroyEntry) At() time.Time
func (*FileHistroyEntry) Path ¶
func (this *FileHistroyEntry) Path() string
func (*FileHistroyEntry) Reader ¶
func (this *FileHistroyEntry) Reader() (r io.ReadCloser, err error)
type RotationDuration ¶
type RotationDuration byte
const ( Monthly RotationDuration = 'M' Weekly RotationDuration = 'W' Daily RotationDuration = 'D' Hourly RotationDuration = 'h' Minutely RotationDuration = 'm' Yearly RotationDuration = 'Y' )
func (RotationDuration) Valid ¶
func (this RotationDuration) Valid() bool
type Rotator ¶
type Rotator struct { Path string Options Options Log logging.Logger // contains filtered or unexported fields }
func (*Rotator) AutoRotate ¶
func (this *Rotator) AutoRotate(increaseSize int) (entry *FileHistroyEntry, err error)
func (*Rotator) Rotate ¶
func (this *Rotator) Rotate() (entry *FileHistroyEntry, err error)
func (*Rotator) RotateOptions ¶
Click to show internal directories.
Click to hide internal directories.