modelRT/constants/recommend_keys.go

91 lines
3.5 KiB
Go

// Package constants define constant variable
package constants
const (
// RedisAllGridSetKey define redis set key which store all grid keys
RedisAllGridSetKey = "grid_keys"
// RedisAllZoneSetKey define redis set key which store all zone keys
RedisAllZoneSetKey = "zone_keys"
// RedisAllStationSetKey define redis set key which store all station keys
RedisAllStationSetKey = "station_keys"
// RedisAllCompNSPathSetKey define redis set key which store all component nspath keys
RedisAllCompNSPathSetKey = "component_nspath_keys"
// RedisAllCompTagSetKey define redis set key which store all component tag keys
RedisAllCompTagSetKey = "component_tag_keys"
// RedisAllConfigSetKey define redis set key which store all config keys
RedisAllConfigSetKey = "config_keys"
// RedisAllMeasTagSetKey define redis set key which store all measurement tag keys
RedisAllMeasTagSetKey = "measurement_tag_keys"
// RedisSpecGridZoneSetKey define redis set key which store all zone keys under specific grid
RedisSpecGridZoneSetKey = "%s_zones_keys"
// RedisSpecZoneStationSetKey define redis set key which store all station keys under specific zone
RedisSpecZoneStationSetKey = "%s_stations_keys"
// RedisSpecStationCompNSPATHSetKey define redis set key which store all component nspath keys under specific station
RedisSpecStationCompNSPATHSetKey = "%s_components_nspath_keys"
// RedisSpecStationCompTagSetKey define redis set key which store all component tag keys under specific station
RedisSpecStationCompTagSetKey = "%s_components_tag_keys"
// RedisSpecCompTagMeasSetKey define redis set key which store all measurement keys under specific component tag
RedisSpecCompTagMeasSetKey = "%s_measurement_keys"
)
const (
// SearchLinkAddAction define search link add action
SearchLinkAddAction = "add"
// SearchLinkDelAction define search link del action
SearchLinkDelAction = "del"
)
// RecommendHierarchyType define the hierarchy levels used for redis recommend search
type RecommendHierarchyType int
const (
// GridRecommendHierarchyType define grid hierarch for redis recommend search
GridRecommendHierarchyType RecommendHierarchyType = iota + 1
// ZoneRecommendHierarchyType define zone hierarch for redis recommend search
ZoneRecommendHierarchyType
// StationRecommendHierarchyType define station hierarch for redis recommend search
StationRecommendHierarchyType
// CompNSPathRecommendHierarchyType define component nspath hierarch for redis recommend search
CompNSPathRecommendHierarchyType
// CompTagRecommendHierarchyType define component tag hierarch for redis recommend search
CompTagRecommendHierarchyType
// ConfigRecommendHierarchyType define config hierarch for redis recommend search
ConfigRecommendHierarchyType
// MeasTagRecommendHierarchyType define measurement tag hierarch for redis recommend search
MeasTagRecommendHierarchyType
)
// String implements fmt.Stringer interface and returns the string representation of the type.
func (r RecommendHierarchyType) String() string {
switch r {
case GridRecommendHierarchyType:
return "grid_tag"
case ZoneRecommendHierarchyType:
return "zone_tag"
case StationRecommendHierarchyType:
return "station_tag"
case CompNSPathRecommendHierarchyType:
return "comp_nspath"
case CompTagRecommendHierarchyType:
return "comp_tag"
case ConfigRecommendHierarchyType:
return "config"
case MeasTagRecommendHierarchyType:
return "meas_tag"
default:
// 返回一个包含原始数值的默认字符串,以便于调试
return "unknown_recommend_type(" + string(rune(r)) + ")"
}
}