mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-05-06 01:07:13 +00:00
35 lines
553 B
Go
35 lines
553 B
Go
package configStructs
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path"
|
|
)
|
|
|
|
const (
|
|
FileLogsName = "file"
|
|
)
|
|
|
|
type LogsConfig struct {
|
|
FileStr string `yaml:"file"`
|
|
}
|
|
|
|
func (config *LogsConfig) Validate() error {
|
|
if config.FileStr == "" {
|
|
_, err := os.Getwd()
|
|
if err != nil {
|
|
return fmt.Errorf("failed to get PWD, %v (try using `mizu logs -f <full path dest zip file>)`", err)
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (config *LogsConfig) FilePath() string {
|
|
if config.FileStr == "" {
|
|
pwd, _ := os.Getwd()
|
|
return path.Join(pwd, "mizu_logs.zip")
|
|
}
|
|
|
|
return config.FileStr
|
|
} |