Documentation
¶
Index ¶
- Constants
- Variables
- type File
- func (rf *File) Close() error
- func (rf *File) Dir() string
- func (rf *File) Name() string
- func (rf *File) OpenFile(flag int) (*os.File, error)
- func (rf *File) PreviousRotation() time.Time
- func (rf *File) Rotate() (err error)
- func (rf *File) Rotations() int
- func (rf *File) SELinuxContext() (string, error)
- func (rf *File) Stat() (fsutils.FileInfo, error)
- func (rf *File) Write(p []byte) (n int, err error)
- type Option
Constants ¶
View Source
const ( DefaultArchivePerm = 0750 DefaultFilePerm = 0640 MaxSequence = 99999 )
Variables ¶
View Source
var ( Error = errors.New("rotatefile") ErrOption = fmt.Errorf("%w option", Error) ErrMaxSequence = fmt.Errorf("%w maximum sequence %d reached", Error, MaxSequence) )
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) OpenFile ¶
File calls os.OpenFile with given flags. It returns a new file descriptor that shares the same underlying file, but does not replace internal file descriptor. Caller is responsible for closing the returned file descriptor.
func (*File) PreviousRotation ¶
func (*File) SELinuxContext ¶
SELinuxContext retrieves the file's SELinux context (e.g., "unconfined_u:object_r:config_home_t:s0").
type Option ¶
func ArchiveDir ¶
ArchiveDir sets the directory where rotated files will be archived. default is same directory. If directory does not exits it will be created. If mode is 0, DefaultArchiveDirMode will be used. If oprion is not set file is rotated in same directory.
func FileMode ¶
FileMode sets the file mode for the rotated files. If mode is 0, DefaultFileMode will be used.
func RotateOnOpen ¶
func RotateOnOpen() Option
func RotatedFilePrefix ¶
Click to show internal directories.
Click to hide internal directories.