1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00
thalos/app/log/config.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())
}