Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvVariableOrDefault ¶
Types ¶
type FileWriter ¶
type FileWriter interface { // Write - write the interface to the file Write(data interface{}) error Close() }
FileWriter - an interface for writing to files
type RollingFileConfiguration ¶
RollingFileConfiguration - configuration for rolling file writer
func GetDefaultFileConfiguration ¶
func GetDefaultFileConfiguration() *RollingFileConfiguration
GetDefaultFileConfiguration - return default configuration
func NewRollingFileConfiguration ¶
func NewRollingFileConfiguration(maxSize, maxBackups, maxAgeInDays int) *RollingFileConfiguration
NewRollingFileConfiguration - Ctor to create a new Rolling file configuration
type RollingFileWriter ¶
type RollingFileWriter struct {
// contains filtered or unexported fields
}
RollingFileWriter - helper object can be use to write objects to rolling files RollingFileWriter implements FileWriter interface
func NewRollingFileWriter ¶
func NewRollingFileWriter(filePath string) *RollingFileWriter
NewRollingFileWriter - Ctor to create a new Rolling file writer maxSize - megabytes after which new file is created maxBackups - number of backups maxAge - max time in days before removing backup
func (*RollingFileWriter) Close ¶
func (rollingFileWriter *RollingFileWriter) Close()
Close the writer
func (*RollingFileWriter) SetRollingFileConfiguration ¶
func (rollingFileWriter *RollingFileWriter) SetRollingFileConfiguration(configuration *RollingFileConfiguration)
SetRollingFileConfiguration - set rolling file configuration
func (*RollingFileWriter) Write ¶
func (rollingFileWriter *RollingFileWriter) Write(data interface{}) error
Write data to file