gocommon/log/enum.go
Matthieu 'JP' DERASSE 5591da9c47
Some checks failed
continuous-integration/drone/push Build is failing
feat(log): Working on log library
2022-11-28 22:06:42 +00:00

37 lines
801 B
Go

package log
// Provider Name Enum
// ProviderName is a provider that will receive the logs.
type ProviderName string
//nolint:exported // keeping the enum simple and readable.
const (
ProviderName_NONE ProviderName = "NONE"
ProviderName_FILE ProviderName = "FILE"
ProviderName_GELF ProviderName = "GELF"
)
// IsValid check if the gaven ProviderName is part of the list of handled provider name.
func (e ProviderName) IsValid() bool {
for _, v := range GetListProviderName() {
if e == v {
return true
}
}
return false
}
func (e ProviderName) String() string {
return string(e)
}
// GetListProviderName return a the list of possible ProviderName.
func GetListProviderName() []ProviderName {
return []ProviderName{
ProviderName_NONE,
ProviderName_FILE,
ProviderName_GELF,
}
}