mirror of https://github.com/tailscale/tailscale/
sockstats: switch label to enum
Makes it cheaper/simpler to persist values, and encourages reuse of labels as opposed to generating an arbitrary number. Updates tailscale/corp#9230 Updates #3363 Signed-off-by: Mihai Parparita <mihai@tailscale.com>pull/7479/head
parent
9687f3700d
commit
6ac6ddbb47
@ -0,0 +1,32 @@
|
|||||||
|
// Code generated by "stringer -type Label -trimprefix Label"; DO NOT EDIT.
|
||||||
|
|
||||||
|
package sockstats
|
||||||
|
|
||||||
|
import "strconv"
|
||||||
|
|
||||||
|
func _() {
|
||||||
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||||
|
// Re-run the stringer command to generate them again.
|
||||||
|
var x [1]struct{}
|
||||||
|
_ = x[LabelControlClientAuto-0]
|
||||||
|
_ = x[LabelControlClientDialer-1]
|
||||||
|
_ = x[LabelDERPHTTPClient-2]
|
||||||
|
_ = x[LabelLogtailLogger-3]
|
||||||
|
_ = x[LabelDNSForwarderDoH-4]
|
||||||
|
_ = x[LabelDNSForwarderUDP-5]
|
||||||
|
_ = x[LabelNetcheckClient-6]
|
||||||
|
_ = x[LabelPortmapperClient-7]
|
||||||
|
_ = x[LabelMagicsockConnUDP4-8]
|
||||||
|
_ = x[LabelMagicsockConnUDP6-9]
|
||||||
|
}
|
||||||
|
|
||||||
|
const _Label_name = "ControlClientAutoControlClientDialerDERPHTTPClientLogtailLoggerDNSForwarderDoHDNSForwarderUDPNetcheckClientPortmapperClientMagicsockConnUDP4MagicsockConnUDP6"
|
||||||
|
|
||||||
|
var _Label_index = [...]uint8{0, 17, 36, 50, 63, 78, 93, 107, 123, 140, 157}
|
||||||
|
|
||||||
|
func (i Label) String() string {
|
||||||
|
if i >= Label(len(_Label_index)-1) {
|
||||||
|
return "Label(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||||
|
}
|
||||||
|
return _Label_name[_Label_index[i]:_Label_index[i+1]]
|
||||||
|
}
|
Loading…
Reference in New Issue