35 lines
524 B
Go
35 lines
524 B
Go
package meta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strconv"
|
|
)
|
|
|
|
const (
|
|
PROBE_STATUS_INITIAL = 1
|
|
PROBE_STATUS_NORMAL = 2
|
|
)
|
|
|
|
var metaProbeStatusMap = map[int]string{
|
|
1: "INITIAL",
|
|
2: "NORMAL",
|
|
}
|
|
|
|
type MetaProbeStatus struct {
|
|
Id json.Number `json:"id,Number,omitempty"`
|
|
Name string `json:"name,omitempty"`
|
|
}
|
|
|
|
func NewMetaProbeStatus(types int) *MetaProbeStatus {
|
|
|
|
str := metaProbeStatusMap[types]
|
|
|
|
if len(str) <= 0 {
|
|
return nil
|
|
}
|
|
return &MetaProbeStatus{
|
|
Id: json.Number(strconv.Itoa(types)),
|
|
Name: str,
|
|
}
|
|
}
|