gocommon/tracing/enum.go
Matthieu 'JP' DERASSE 06f0722cdb
All checks were successful
continuous-integration/drone/push Build is passing
feat(tracing): Start to implement tracing system
2022-12-14 17:09:05 +00:00

35 lines
759 B
Go

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,
}
}