common

package
v1.6.65 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DB_NAME_APPLICATION_LOG = "application_log"
View Source
const DB_NAME_DEEPFLOW_ADMIN = "deepflow_admin"
View Source
const DB_NAME_DEEPFLOW_SYSTEM = "deepflow_system" // Abandoned
View Source
const DB_NAME_DEEPFLOW_TENANT = "deepflow_tenant"
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_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 TABLE_NAME_SPAN_WITH_TRACE_ID = "span_with_trace_id"
View Source
const TABLE_NAME_TRACE_TREE = "trace_tree"
View Source
const TABLE_NAME_VTAP_ACL = "traffic_policy"
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{"network", "network_map", "application", "application_map", "traffic_policy"},
	DB_NAME_EXT_METRICS:     []string{"ext_common"},
	DB_NAME_DEEPFLOW_ADMIN:  []string{"deepflow_server"},
	DB_NAME_DEEPFLOW_TENANT: []string{"deepflow_collector"},
	DB_NAME_EVENT:           []string{"event", "perf_event", "alert_event"},
	DB_NAME_PROFILE:         []string{"in_process"},
	DB_NAME_PROMETHEUS:      []string{"samples"},
	DB_NAME_APPLICATION_LOG: []string{"log"},
}
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", "resource_gl0", "resource_gl1", "resource_gl2", "auto_service", "auto_instance"},
	"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", "chost_ip", "chost_hostname"},
	"gprocess_map":    []string{"gprocess", "chost", "l3_epc"},
	"pod_ingress_map": []string{"pod_cluster", "pod_ns", "pod_ingress"},
	"pod_node_map":    []string{"pod_cluster", "pod_node"},
}

Functions

func GetDatasourceInterval

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

func GetDatasources

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

func GetExtTables

func GetExtTables(db, where, queryCacheTTL, orgID string, useQueryCache bool, ctx context.Context, DebugInfo *client.DebugInfo) (values []interface{})

func IPFilterStringToHex

func IPFilterStringToHex(ip string) string

func ParseAlias

func ParseAlias(node sqlparser.SQLNode) string

func ParseNotSupportedOperator

func ParseNotSupportedOperator(notSupportedOperator interface{}) []string

not_supported_operators parsed as an array

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