file

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchedFileWriter

type BatchedFileWriter struct {
	// contains filtered or unexported fields
}

BatchedFileWriter is the file producer core.BatchedWriter implementation for the core.BatchedWriterAssembly

func NewBatchedFileWriter

func NewBatchedFileWriter(file *os.File, compressOnClose bool, logger logrus.FieldLogger) BatchedFileWriter

NewBatchedFileWriter returns a BatchedFileWriter instance

func (*BatchedFileWriter) Close

func (w *BatchedFileWriter) Close() error

Close is part of the Close interface and handle the file close or compression call

func (*BatchedFileWriter) IsAccessible

func (w *BatchedFileWriter) IsAccessible() bool

IsAccessible is part of the BatchedWriter interface and check if the writer can access his file

func (*BatchedFileWriter) Name

func (w *BatchedFileWriter) Name() string

Name is part of the BatchedWriter interface and wraps the file.Name() implementation

func (*BatchedFileWriter) Size

func (w *BatchedFileWriter) Size() int64

Size is part of the BatchedWriter interface and wraps the file.Stat().Size() implementation

func (*BatchedFileWriter) Write

func (w *BatchedFileWriter) Write(p []byte) (n int, err error)

Write is part of the BatchedWriter interface and wraps the file.Write() implementation

type Pruner

type Pruner struct {
	Logger logrus.FieldLogger // Logger need to set
	// contains filtered or unexported fields
}

Pruner file producer pruning component

Parameters

- Prune/Count: this value removes old logfiles upon rotate so that only the given number of logfiles remain. Logfiles are located by the name defined by "File" and are pruned by date (followed by name). Set this value to "0" to disable pruning by count. By default this parameter is set to "0".

- Prune/AfterHours: This value removes old logfiles that are older than a given number of hours. Set this value to "0" to disable pruning by lifetime. By default this parameter is set to "0".

- Prune/TotalSizeMB: This value removes old logfiles upon rotate so that only the given number of MBs are used by logfiles. Logfiles are located by the name defined by "File" and are pruned by date (followed by name). Set this value to "0" to disable pruning by file size. By default this parameter is set to "0".

func (*Pruner) Configure

func (pruner *Pruner) Configure(conf core.PluginConfigReader)

Configure initializes this object with values from a plugin config.

func (*Pruner) Prune

func (pruner *Pruner) Prune(baseFilePath string)

Prune starts prune methods by hours, by count and by size

type TargetFile

type TargetFile struct {
	// contains filtered or unexported fields
}

TargetFile is a struct for file producer target files

func NewTargetFile

func NewTargetFile(fileDir, fileName, fileExt string, permissions os.FileMode) TargetFile

NewTargetFile returns a new TargetFile instance

func (*TargetFile) GetDir

func (streamFile *TargetFile) GetDir() (string, error)

GetDir create file directory if it not exists and returns the dir name

func (*TargetFile) GetFinalName

func (streamFile *TargetFile) GetFinalName(rotate components.RotateConfig) string

GetFinalName returns the final file name with possible rotations

func (*TargetFile) GetFinalPath

func (streamFile *TargetFile) GetFinalPath(rotate components.RotateConfig) string

GetFinalPath returns the final file path with possible rotations

func (*TargetFile) GetOriginalPath

func (streamFile *TargetFile) GetOriginalPath() string

GetOriginalPath returns the base path from instantiation

func (*TargetFile) GetSymlinkPath

func (streamFile *TargetFile) GetSymlinkPath() string

GetSymlinkPath returns a symlink path for the current file

Jump to

Keyboard shortcuts

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