mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
27 lines
534 B
Go
27 lines
534 B
Go
package log
|
|
|
|
import (
|
|
"path"
|
|
"time"
|
|
|
|
"github.com/eosswedenorg/thalos/app/types"
|
|
)
|
|
|
|
type Config struct {
|
|
Filename string `yaml:"filename"`
|
|
Directory string `yaml:"directory"`
|
|
MaxFileSize types.Size `yaml:"maxfilesize"`
|
|
MaxTime time.Duration `yaml:"maxtime"`
|
|
}
|
|
|
|
func (c Config) GetFilename() string {
|
|
return path.Base(c.Filename)
|
|
}
|
|
|
|
func (c Config) GetDirectory() string {
|
|
return path.Clean(c.Directory)
|
|
}
|
|
|
|
func (c Config) GetFilePath() string {
|
|
return path.Join(c.GetDirectory(), c.GetFilename())
|
|
}
|