37 lines
801 B
Go
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,
|
||
|
}
|
||
|
}
|