gocommon/tracing/enum.go

35 lines
759 B
Go
Raw Normal View History

package tracing
// Exporter Name Enum
// ExporterName is an exporter that will receive the tracing.
type ExporterName string
//nolint:exported // keeping the enum simple and readable.
const (
ExporterName_JAEGER ExporterName = "JAEGER"
ExporterName_ZIPKIN ExporterName = "ZIPKIN"
)
// IsValid check if the gaven ExporterName is part of the list of handled exporter name.
func (e ExporterName) IsValid() bool {
for _, v := range GetListExporterName() {
if e == v {
return true
}
}
return false
}
func (e ExporterName) String() string {
return string(e)
}
// GetListExporterName return a the list of possible ExporterName.
func GetListExporterName() []ExporterName {
return []ExporterName{
ExporterName_JAEGER,
ExporterName_ZIPKIN,
}
}