common

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DB_NAME_EVENT = "event"
View Source
const DB_NAME_EXT_METRICS = "ext_metrics"
View Source
const DB_NAME_FLOW_LOG = "flow_log"
View Source
const DB_NAME_FLOW_METRICS = "flow_metrics"
View Source
const DB_NAME_FLOW_TAG = "flow_tag"
View Source
const DB_NAME_OBSERVATRACE_SYSTEM = "observatrace_system"
View Source
const DB_NAME_PROFILE = "profile"
View Source
const DB_NAME_PROMETHEUS = "prometheus"
View Source
const FormatHex = "hex"
View Source
const IndexTypeIncremetalId = "incremental-id"
View Source
const PERMISSION_TYPE_NUM = 3
View Source
const TagClientChPrefix = "客户端"
View Source
const TagClientEnPrefix = "Client"
View Source
const TagServerChPrefix = "服务端"
View Source
const TagServerEnPrefix = "Server"

Variables

View Source
var DB_TABLE_MAP = map[string][]string{
	DB_NAME_FLOW_LOG:            []string{"l4_flow_log", "l7_flow_log", "l4_packet", "l7_packet"},
	DB_NAME_FLOW_METRICS:        []string{"vtap_flow_port", "vtap_flow_edge_port", "vtap_app_port", "vtap_app_edge_port", "vtap_acl"},
	DB_NAME_EXT_METRICS:         []string{"ext_common"},
	DB_NAME_OBSERVATRACE_SYSTEM: []string{"observatrace_system_common"},
	DB_NAME_EVENT:               []string{"event", "perf_event", "alarm_event"},
	DB_NAME_PROFILE:             []string{"in_process"},
	DB_NAME_PROMETHEUS:          []string{"samples"},
}
View Source
var SHOW_TAG_VALUE_MAP = map[string][]string{
	"ip_resource_map": []string{"ip", "subnet", "region", "az", "host", "chost", "l3_epc", "router", "dhcpgw", "lb", "lb_listener", "natgw", "redis", "rds", "pod_cluster", "pod_ns", "pod_node", "pod_ingress", "pod_service", "pod_group", "pod"},
	"pod_ns_map":      []string{"pod_ns", "pod_cluster"},
	"pod_group_map":   []string{"pod_group", "pod_cluster", "pod_ns"},
	"pod_service_map": []string{"pod_service", "pod_cluster", "pod_ns"},
	"pod_map":         []string{"pod", "pod_cluster", "pod_ns", "pod_node", "pod_service", "pod_group"},
	"chost_map":       []string{"chost", "host", "l3_epc"},
	"gprocess_map":    []string{"gprocess", "chost", "l3_epc"},
}

Functions

func GetDatasourceInterval

func GetDatasourceInterval(db string, table string, name string) (int, error)

func GetDatasources

func GetDatasources(db string, table string) ([]string, error)

func GetExtTables

func GetExtTables(db string, ctx context.Context) (values []interface{})

func GetPrometheusTables

func GetPrometheusTables(db string, ctx context.Context) (values []interface{})

func IPFilterStringToHex

func IPFilterStringToHex(ip string) string

func ParseAlias

func ParseAlias(node sqlparser.SQLNode) string

func ParsePermission

func ParsePermission(permission interface{}) ([]bool, error)

Permissions解析为数组 最高十进制位:用户组A是否有权限,通常可用于代表管理员用户组 第二个十进制位:用户组B是否有权限,通常可用于代表OnPrem租户用户组 最低十进制位:用户组C是否有权限,通常可用于代表SaaS租户用户组

func ParseResponse

func ParseResponse(response *http.Response) (map[string]interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL