Files
kubescape/core/cautils/rootinfo.go
Daniel Grunberger 26c47d501c move context flag to root (#1367)
* move context flag to root

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* rm from httphandler

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

---------

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-09-03 10:39:15 +03:00

32 lines
864 B
Go

package cautils
import (
"fmt"
"github.com/google/uuid"
)
type RootInfo struct {
Logger string // logger level
LoggerName string // logger name ("pretty"/"zap"/"none")
CacheDir string // cached dir
DisableColor bool // Disable Color
EnableColor bool // Force enable Color
DiscoveryServerURL string // Discovery Server URL (See https://github.com/kubescape/backend/tree/main/pkg/servicediscovery)
KubeContext string // context name
}
type CloudURLs struct {
CloudReportURL string
CloudAPIURL string
}
// To check if the provided account ID is valid
func ValidateAccountID(accountID string) error {
// Check if the Account-ID is valid
if _, err := uuid.Parse(accountID); accountID != "" && err != nil {
return fmt.Errorf("bad argument: accound ID must be a valid UUID")
}
return nil
}