tagrecorder

package
v0.0.0-...-77199df Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

tagrecorder包中使用到的泛型约束

Index

Constants

View Source
const (
	RESOURCE_TYPE_REGION            = "region"
	RESOURCE_TYPE_AZ                = "az"
	RESOURCE_TYPE_HOST              = "host"
	RESOURCE_TYPE_VPC               = "epc"
	RESOURCE_TYPE_NAT_GATEWAY       = "nat_gateway"
	RESOURCE_TYPE_LB                = "lb"
	RESOURCE_TYPE_VL2               = "vl2"
	RESOURCE_TYPE_REDIS             = "redis_instance"
	RESOURCE_TYPE_RDS               = "rds_instance"
	RESOURCE_TYPE_VM                = "vm"
	RESOURCE_TYPE_VGW               = "vgateway"
	RESOURCE_TYPE_DHCP_PORT         = "dhcp_port"
	RESOURCE_TYPE_IP                = "ip"
	RESOURCE_TYPE_POD_CLUSTER       = "pod_cluster"
	RESOURCE_TYPE_POD_NODE          = "pod_node"
	RESOURCE_TYPE_POD_NAMESPACE     = "pod_namespace"
	RESOURCE_TYPE_POD_GROUP         = "pod_group"
	RESOURCE_TYPE_POD_SERVICE       = "pod_service"
	RESOURCE_TYPE_POD               = "pod"
	RESOURCE_TYPE_INTERNET          = "internet"
	RESOURCE_TYPE_INTERNET_IP       = "internet_ip"
	RESOURCE_TYPE_VINTERFACE        = "vinterface"
	RESOURCE_TYPE_WANIP             = "wan_ip"
	RESOURCE_TYPE_LANIP             = "lan_ip"
	RESOURCE_TYPE_NAT_RULE          = "nat_rule"
	RESOURCE_TYPE_NAT_VM_CONNECTION = "nat_vm_connection"
	RESOURCE_TYPE_LB_LISTENER       = "lb_listener"
	RESOURCE_TYPE_LB_TARGET_SERVER  = "lb_target_server"
	RESOURCE_TYPE_LB_VM_CONNECTION  = "lb_vm_connection"
	RESOURCE_TYPE_POD_GROUP_PORT    = "pod_group_port"
	RESOURCE_TYPE_POD_INGRESS       = "pod_ingress"
	RESOURCE_TYPE_SERVICE           = "service"
	RESOURCE_TYPE_GPROCESS          = "gprocess"
)
View Source
const (
	RESOURCE_TYPE_CH_K8S_ANNOTATION  = "ch_k8s_annotation"
	RESOURCE_TYPE_CH_K8S_ANNOTATIONS = "ch_k8s_annotations"
	RESOURCE_TYPE_CH_K8S_ENV         = "ch_k8s_env"
	RESOURCE_TYPE_CH_K8S_ENVS        = "ch_k8s_envs"

	RESOURCE_TYPE_CH_K8S_LABEL         = "ch_k8s_label"
	RESOURCE_TYPE_CH_K8S_LABELS        = "ch_k8s_labels"
	RESOURCE_TYPE_CH_VM_CLOUD_TAG      = "ch_chost_cloud_tag"
	RESOURCE_TYPE_CH_POD_NS_CLOUD_TAG  = "ch_pod_namespace_cloud_tag"
	RESOURCE_TYPE_CH_VM_CLOUD_TAGS     = "ch_chost_cloud_tags"
	RESOURCE_TYPE_CH_POD_NS_CLOUD_TAGS = "ch_pod_namespace_cloud_tags"
	RESOURCE_TYPE_CH_OS_APP_TAG        = "ch_os_app_tag"
	RESOURCE_TYPE_CH_OS_APP_TAGS       = "ch_os_app_tags"
	RESOURCE_TYPE_CH_REGION            = "ch_region"
	RESOURCE_TYPE_CH_AZ                = "ch_az"
	RESOURCE_TYPE_CH_VPC               = "ch_vpc"
	RESOURCE_TYPE_CH_DEVICE            = "ch_device"
	RESOURCE_TYPE_CH_IP_RELATION       = "ch_ip_relation"
	RESOURCE_TYPE_CH_IP_RESOURCE       = "ch_ip_resource"

	RESOURCE_TYPE_CH_POD_PORT       = "ch_pod_port"
	RESOURCE_TYPE_CH_POD_NODE_PORT  = "ch_pod_node_port"
	RESOURCE_TYPE_CH_POD_GROUP_PORT = "ch_pod_group_port"
	RESOURCE_TYPE_CH_IP_PORT        = "ch_ip_port"
	RESOURCE_TYPE_CH_DEVICE_PORT    = "ch_device_port"

	RESOURCE_TYPE_CH_NETWORK        = "ch_network"
	RESOURCE_TYPE_CH_POD            = "ch_pod"
	RESOURCE_TYPE_CH_POD_GROUP      = "ch_pod_group"
	RESOURCE_TYPE_CH_POD_GROUP_TYPE = "ch_pod_group_type"
	RESOURCE_TYPE_CH_POD_INGRESS    = "ch_pod_ingress"
	RESOURCE_TYPE_CH_POD_NAMESPACE  = "ch_pod_namespace"
	RESOURCE_TYPE_CH_POD_NODE       = "ch_pod_node"
	RESOURCE_TYPE_TAP_TYPE          = "ch_tap_type"
	RESOURCE_TYPE_CH_VTAP           = "ch_vtap"
	RESOURCE_TYPE_CH_VTAP_PORT      = "ch_vtap_port"
	RESOURCE_TYPE_CH_LB_LISTENER    = "ch_lb_listener"
	RESOURCE_TYPE_CH_STRING_ENUM    = "ch_string_enum"
	RESOURCE_TYPE_CH_INT_ENUM       = "ch_int_enum"
	RESOURCE_TYPE_CH_NODE_TYPE      = "ch_node_type"
	RESOURCE_TYPE_CH_GPROCESS       = "ch_gprocess"
	RESOURCE_TYPE_CH_POD_SERVICE    = "ch_pod_service"
	RESOURCE_TYPE_CH_CHOST          = "ch_chost"
	RESOURCE_TYPE_CH_POLICY         = "ch_policy"
	RESOURCE_TYPE_CH_NPB_TUNNEL     = "ch_npb_tunnel"
	RESOURCE_TYPE_CH_ALARM_POLICY   = "ch_alarm_policy"

	RESOURCE_TYPE_CH_POD_GROUP_DEPLOYMENT            = "pod_group_deployment"
	RESOURCE_TYPE_CH_POD_GROUP_STATEFULSET           = "pod_group_statefulset"
	RESOURCE_TYPE_CH_POD_GROUP_RC                    = "pod_group_rc"
	RESOURCE_TYPE_CH_POD_GROUP_DAEMON_SET            = "pod_group_daemon_set"
	RESOURCE_TYPE_CH_POD_GROUP_REPLICASET_CONTROLLER = "pod_group_replicaset_controller"
	RESOURCE_TYPE_CH_POD_GROUP_CLONESET              = "pod_group_cloneset"

	RESOURCE_TYPE_CH_PROMETHEUS_METRIC_APP_LABEL_LAYOUT = "ch_promytheus_metric_app_label_layout"
	RESOURCE_TYPE_CH_TARGET_LABEL                       = "ch_target_label"
	RESOURCE_TYPE_CH_APP_LABEL                          = "ch_app_label"
	RESOURCE_TYPE_CH_LABEL_NAME                         = "ch_prometheus_label_name"
	RESOURCE_TYPE_CH_METRIC_NAME                        = "ch_prometheus_metric_name"
	RESOURCE_TYPE_CH_PROMETHEUS_TARGET_LABEL_LAYOUT     = "ch_prometheus_target_label_layout"
)
View Source
const (
	CH_DICTIONARY_POD_K8S_ANNOTATION          = "pod_k8s_annotation_map"
	CH_DICTIONARY_POD_K8S_ANNOTATIONS         = "pod_k8s_annotations_map"
	CH_DICTIONARY_POD_SERVICE_K8S_ANNOTATION  = "pod_service_k8s_annotation_map"
	CH_DICTIONARY_POD_SERVICE_K8S_ANNOTATIONS = "pod_service_k8s_annotations_map"
	CH_DICTIONARY_POD_K8S_ENV                 = "pod_k8s_env_map"
	CH_DICTIONARY_POD_K8S_ENVS                = "pod_k8s_envs_map"

	CH_DICTIONARY_REGION        = "region_map"
	CH_DICTIONARY_AZ            = "az_map"
	CH_DICTIONARY_DEVICE        = "device_map" // vm, host, vgw, dhcp_port, pod, pod_service, pod_node, redis, rds, lb, nat
	CH_DICTIONARY_VPC           = "l3_epc_map"
	CH_DICTIONARY_VL2           = "subnet_map"
	CH_DICTIONARY_POD_CLUSTER   = "pod_cluster_map"
	CH_DICTIONARY_POD_NAMESPACE = "pod_ns_map"
	CH_DICTIONARY_POD_NODE      = "pod_node_map"
	CH_DICTIONARY_POD_GROUP     = "pod_group_map"
	CH_DICTIONARY_POD_INGRESS   = "pod_ingress_map"
	CH_DICTIONARY_POD           = "pod_map"
	CH_DICTIONARY_VTAP_PORT     = "vtap_port_map"
	CH_DICTIONARY_TAP_TYPE      = "tap_type_map"
	CH_DICTIONARY_VTAP          = "vtap_map"
	CH_DICTIONARY_LB_LISTENER   = "lb_listener_map"

	CH_DICTIONARY_POD_K8S_LABEL  = "pod_k8s_label_map"
	CH_DICTIONARY_POD_K8S_LABELS = "pod_k8s_labels_map"

	CH_DICTIONARY_POD_SERVICE_K8S_LABEL  = "pod_service_k8s_label_map"
	CH_DICTIONARY_POD_SERVICE_K8S_LABELS = "pod_service_k8s_labels_map"

	CH_DICTIONARY_CHOST_CLOUD_TAG   = "chost_cloud_tag_map"
	CH_DICTIONARY_POD_NS_CLOUD_TAG  = "pod_ns_cloud_tag_map"
	CH_DICTIONARY_CHOST_CLOUD_TAGS  = "chost_cloud_tags_map"
	CH_DICTIONARY_POD_NS_CLOUD_TAGS = "pod_ns_cloud_tags_map"
	CH_DICTIONARY_OS_APP_TAG        = "os_app_tag_map"
	CH_DICTIONARY_OS_APP_TAGS       = "os_app_tags_map"

	CH_DICTIONARY_POD_NODE_PORT  = "pod_node_port_map"
	CH_DICTIONARY_POD_GROUP_PORT = "pod_group_port_map"
	CH_DICTIONARY_POD_PORT       = "pod_port_map"
	CH_DICTIONARY_DEVICE_PORT    = "device_port_map"
	CH_DICTIONARY_IP_PORT        = "ip_port_map"
	CH_DICTIONARY_SERVER_PORT    = "server_port_map"

	CH_DICTIONARY_IP_RELATION = "ip_relation_map"
	CH_DICTIONARY_IP_RESOURCE = "ip_resource_map"

	CH_DICTIONARY_POD_SERVICE = "pod_service_map"
	CH_DICTIONARY_CHOST       = "chost_map"

	CH_STRING_DICTIONARY_ENUM = "string_enum_map"
	CH_INT_DICTIONARY_ENUM    = "int_enum_map"

	CH_DICTIONARY_NODE_TYPE = "node_type_map"
	CH_DICTIONARY_GPROCESS  = "gprocess_map"

	CH_DICTIONARY_POLICY     = "policy_map"
	CH_DICTIONARY_NPB_TUNNEL = "npb_tunnel_map"

	CH_DICTIONARY_ALARM_POLICY = "alarm_policy_map"

	CH_TARGET_LABEL                       = "target_label_map"
	CH_APP_LABEL                          = "app_label_map"
	CH_PROMETHEUS_LABEL_NAME              = "prometheus_label_name_map"
	CH_PROMETHEUS_METRIC_NAME             = "prometheus_metric_name_map"
	CH_PROMETHEUS_METRIC_APP_LABEL_LAYOUT = "prometheus_metric_app_label_layout_map"
	CH_PROMETHEUS_TARGET_LABEL_LAYOUT     = "prometheus_target_label_layout_map"

	CH_APP_LABEL_LIVE_VIEW    = "app_label_live_view"
	CH_TARGET_LABEL_LIVE_VIEW = "target_label_live_view"
)
View Source
const (
	CH_DEVICE_TYPE_IP        = 64000
	CH_DEVICE_TYPE_INTERNET  = 63999
	CH_DEVICE_TYPE_GPROCESS  = 120
	CH_DEVICE_TYPE_POD_GROUP = 101
	CH_DEVICE_TYPE_SERVICE   = 102

	CH_VTAP_PORT_TYPE_TAP_MAC = 1
	CH_VTAP_PORT_TYPE_MAC     = 2
	CH_VTAP_PORT_NAME_MAX     = 10
)
View Source
const (
	CREATE_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_REGION_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_VPC_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `uid` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_TAP_TYPE_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `value` UInt64,\n" +
		"    `name` String\n" +
		")\n" +
		"PRIMARY KEY value\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_VTAP_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `type` Int64,\n" +
		"    `icon_id` Int64,\n" +
		"    `team_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_DEVICE_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `devicetype` UInt64,\n" +
		"    `deviceid` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `uid` String,\n" +
		"    `hostname` String,\n" +
		"    `ip` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY devicetype, deviceid\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_VTAP_PORT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `vtap_id` UInt64,\n" +
		"    `tap_port` UInt64,\n" +
		"    `name` String,\n" +
		"    `host_id` Int64,\n" +
		"    `host_name` String,\n" +
		"    `device_type` UInt64,\n" +
		"    `device_id` UInt64,\n" +
		"    `device_name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `team_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY vtap_id, tap_port\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_PORT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `protocol` UInt64,\n" +
		"    `port` UInt64,\n" +
		"    `port_lb_id` UInt64,\n" +
		"    `port_lb_name` String,\n" +
		"    `port_lb_listener_id` UInt64,\n" +
		"    `port_lb_listener_name` String,\n" +
		"    `port_pod_service_id` UInt64,\n" +
		"    `port_pod_service_name` String\n" +
		")\n" +
		"PRIMARY KEY id, protocol, port\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_IP_PORT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `ip` String,\n" +
		"    `subnet_id` UInt64,\n" +
		"    `protocol` UInt64,\n" +
		"    `port` UInt64,\n" +
		"    `port_lb_id` UInt64,\n" +
		"    `port_lb_name` String,\n" +
		"    `port_lb_listener_id` UInt64,\n" +
		"    `port_lb_listener_name` String,\n" +
		"    `port_pod_service_id` UInt64,\n" +
		"    `port_pod_service_name` String\n" +
		")\n" +
		"PRIMARY KEY ip, subnet_id, protocol, port\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_DEVICE_PORT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `devicetype` UInt64,\n" +
		"    `deviceid` UInt64,\n" +
		"    `protocol` UInt64,\n" +
		"    `port` UInt64,\n" +
		"    `port_lb_id` UInt64,\n" +
		"    `port_lb_name` String,\n" +
		"    `port_lb_listener_id` UInt64,\n" +
		"    `port_lb_listener_name` String,\n" +
		"    `port_pod_service_id` UInt64,\n" +
		"    `port_pod_service_name` String\n" +
		")\n" +
		"PRIMARY KEY devicetype, deviceid, protocol, port\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_SERVER_PORT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `server_port` UInt64,\n" +
		"    `server_port_name` String\n" +
		")\n" +
		"PRIMARY KEY server_port\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_IP_RELATION_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `ip` String,\n" +
		"    `natgw_id` UInt64,\n" +
		"    `natgw_name` String,\n" +
		"    `lb_id` UInt64,\n" +
		"    `lb_name` String,\n" +
		"    `lb_listener_id` UInt64,\n" +
		"    `lb_listener_name` String,\n" +
		"    `pod_ingress_id` UInt64,\n" +
		"    `pod_ingress_name` String,\n" +
		"    `pod_service_id` UInt64,\n" +
		"    `pod_service_name` String,\n" +
		"    `team_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY l3_epc_id, ip\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_ID_NAME_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_POD_INGRESS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_LB_LISTENER_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `team_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_K8S_LABEL_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `key` String,\n" +
		"    `value` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id, key\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_K8S_LABELS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `labels` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_IP_RESOURCE_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `ip` String,\n" +
		"    `subnet_id` UInt64,\n" +
		"    `subnet_name` String,\n" +
		"    `region_id` UInt64,\n" +
		"    `region_name` String,\n" +
		"    `az_id` UInt64,\n" +
		"    `az_name` String,\n" +
		"    `host_id` UInt64,\n" +
		"    `host_name` String,\n" +
		"    `chost_id` UInt64,\n" +
		"    `chost_name` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `l3_epc_name` String,\n" +
		"    `router_id` UInt64,\n" +
		"    `router_name` String,\n" +
		"    `dhcpgw_id` UInt64,\n" +
		"    `dhcpgw_name` String,\n" +
		"    `lb_id` UInt64,\n" +
		"    `lb_name` String,\n" +
		"    `lb_listener_id` UInt64,\n" +
		"    `lb_listener_name` String,\n" +
		"    `natgw_id` UInt64,\n" +
		"    `natgw_name` String,\n" +
		"    `redis_id` UInt64,\n" +
		"    `redis_name` String,\n" +
		"    `rds_id` UInt64,\n" +
		"    `rds_name` String,\n" +
		"    `pod_cluster_id` UInt64,\n" +
		"    `pod_cluster_name` String,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `pod_ns_name` String,\n" +
		"    `pod_node_id` UInt64,\n" +
		"    `pod_node_name` String,\n" +
		"    `pod_ingress_id` UInt64,\n" +
		"    `pod_ingress_name` String,\n" +
		"    `pod_service_id` UInt64,\n" +
		"    `pod_service_name` String,\n" +
		"    `pod_group_id` UInt64,\n" +
		"    `pod_group_name` String,\n" +
		"    `pod_id` UInt64,\n" +
		"    `pod_name` String,\n" +
		"    `uid` String\n" +
		")\n" +
		"PRIMARY KEY ip, subnet_id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_STRING_ENUM_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `tag_name` String,\n" +
		"    `value` String,\n" +
		"    `name` String,\n" +
		"    `description` String\n" +
		")\n" +
		"PRIMARY KEY tag_name, value\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_INT_ENUM_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `tag_name` String,\n" +
		"    `value` UInt64,\n" +
		"    `name` String,\n" +
		"    `description` String\n" +
		")\n" +
		"PRIMARY KEY tag_name, value\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_NODE_TYPE_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `resource_type` UInt64,\n" +
		"    `node_type` String\n" +
		")\n" +
		"PRIMARY KEY resource_type\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_CLOUD_TAG_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `key` String,\n" +
		"    `value` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id, key\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_CLOUD_TAGS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `cloud_tags` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_OS_APP_TAG_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `pid` UInt64,\n" +
		"    `key` String,\n" +
		"    `value` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY pid, key\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_OS_APP_TAGS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `pid` UInt64,\n" +
		"    `os_app_tags` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY pid\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"

	CREATE_K8S_ANNOTATION_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `key` String,\n" +
		"    `value` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id, key\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_K8S_ANNOTATIONS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `annotations` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_K8S_ENV_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `key` String,\n" +
		"    `value` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id, key\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_K8S_ENVS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `envs` String,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_PROMETHEUS_LABEL_NAME_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_PROMETHEUS_METRIC_APP_LABEL_LAYOUT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `metric_name` String,\n" +
		"    `app_label_name` String,\n" +
		"    `app_label_column_index` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_APP_LABEL_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `label_name_id` UInt64,\n" +
		"    `label_value` String,\n" +
		"    `label_value_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY label_name_id, label_value_id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_TARGET_LABEL_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `metric_id` UInt64,\n" +
		"    `label_name_id` UInt64,\n" +
		"    `label_value` String,\n" +
		"    `target_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY metric_id, label_name_id, target_id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_PROMETHEUS_TARGET_LABEL_LAYOUT_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `target_id` UInt64,\n" +
		"    `target_label_names` String,\n" +
		"    `target_label_values` String\n" +
		")\n" +
		"PRIMARY KEY target_id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_POD_NS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `pod_cluster_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_POD_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `pod_cluster_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `pod_node_id` UInt64,\n" +
		"    `pod_service_id` UInt64,\n" +
		"    `pod_group_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_POD_SERVICE_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `pod_cluster_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_CHOST_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `host_id` UInt64,\n" +
		"    `l3_epc_id` UInt64,\n" +
		"    `hostname` String,\n" +
		"    `ip` String,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_POD_GROUP_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `pod_group_type` UInt64,\n" +
		"    `icon_id` Int64,\n" +
		"    `pod_cluster_id` UInt64,\n" +
		"    `pod_ns_id` UInt64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_GPROCESS_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` UInt64,\n" +
		"    `name` String,\n" +
		"    `icon_id` Int64,\n" +
		"    `chost_id` Int64,\n" +
		"    `l3_epc_id` Int64,\n" +
		"    `team_id` UInt64,\n" +
		"    `domain_id` UInt64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
	CREATE_POLICY_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `tunnel_type` UInt64,\n" +
		"    `acl_gid` UInt64,\n" +
		"    `id` Int64,\n" +
		"    `name` String\n" +
		")\n" +
		"PRIMARY KEY tunnel_type, acl_gid\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(COMPLEX_KEY_HASHED())"
	CREATE_AlARM_POLICY_DICTIONARY_SQL = "CREATE DICTIONARY %s.%s\n" +
		"(\n" +
		"    `id` Int64,\n" +
		"    `name` String,\n" +
		"    `user_id` Int64\n" +
		")\n" +
		"PRIMARY KEY id\n" +
		"SOURCE(MYSQL(PORT %s USER '%s' PASSWORD '%s' %s DB %s TABLE %s INVALIDATE_QUERY 'select(select updated_at from %s order by updated_at desc limit 1) as updated_at'))\n" +
		"LIFETIME(MIN 30 MAX %d)\n" +
		"LAYOUT(FLAT())"
)
View Source
const (
	CREATE_APP_LABEL_LIVE_VIEW_SQL = "CREATE LIVE VIEW %s.app_label_live_view WITH PERIODIC REFRESH %d\n" +
		"(\n" +
		"    `label_name_id` UInt64,\n" +
		"    `label_value_id` UInt64,\n" +
		"    `label_value` String\n" +
		") AS\n" +
		"SELECT *\n" +
		"FROM %s.app_label_map"
	CREATE_TARGET_LABEL_LIVE_VIEW_SQL = "CREATE LIVE VIEW %s.target_label_live_view WITH PERIODIC REFRESH %d\n" +
		"(\n" +
		"    `metric_id` UInt64,\n" +
		"    `label_name_id` UInt64,\n" +
		"    `target_id` UInt64,\n" +
		"    `label_value` String\n" +
		") AS\n" +
		"SELECT *\n" +
		"FROM %s.target_label_map"
)
View Source
const TrisolarisNodeTypeMaster = "master"

Variables

View Source
var CH_IP_RESOURCE_TAGS = []string{
	"region_id", "region_name", "az_id", "az_name", "host_id", "host_name",
	"chost_id", "chost_name", "l3_epc_id", "l3_epc_name", "subnet_id", "subnet_name",
	"router_id", "router_name", "dhcpgw_id", "dhcpgw_name", "lb_id", "lb_name",
	"lb_listener_id", "lb_listener_name", "natgw_id", "natgw_name", "redis_id",
	"redis_name", "rds_id", "rds_name", "pod_cluster_id", "pod_cluster_name",
	"pod_ns_id", "pod_ns_name", "pod_node_id", "pod_node_name",
	"pod_ingress_id", "pod_ingress_name", "pod_service_id", "pod_service_name",
	"pod_group_id", "pod_group_name", "pod_id", "pod_name",
}
View Source
var CREATE_SQL_MAP = map[string]string{
	CH_DICTIONARY_REGION:                 CREATE_REGION_DICTIONARY_SQL,
	CH_DICTIONARY_AZ:                     CREATE_DICTIONARY_SQL,
	CH_DICTIONARY_VPC:                    CREATE_VPC_DICTIONARY_SQL,
	CH_DICTIONARY_VL2:                    CREATE_DICTIONARY_SQL,
	CH_DICTIONARY_POD_CLUSTER:            CREATE_DICTIONARY_SQL,
	CH_DICTIONARY_POD_NAMESPACE:          CREATE_POD_NS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_NODE:               CREATE_DICTIONARY_SQL,
	CH_DICTIONARY_POD_GROUP:              CREATE_POD_GROUP_DICTIONARY_SQL,
	CH_DICTIONARY_POD:                    CREATE_POD_DICTIONARY_SQL,
	CH_DICTIONARY_DEVICE:                 CREATE_DEVICE_DICTIONARY_SQL,
	CH_DICTIONARY_VTAP_PORT:              CREATE_VTAP_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_TAP_TYPE:               CREATE_TAP_TYPE_DICTIONARY_SQL,
	CH_DICTIONARY_VTAP:                   CREATE_VTAP_DICTIONARY_SQL,
	CH_DICTIONARY_POD_NODE_PORT:          CREATE_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_POD_GROUP_PORT:         CREATE_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_POD_PORT:               CREATE_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_DEVICE_PORT:            CREATE_DEVICE_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_IP_PORT:                CREATE_IP_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_SERVER_PORT:            CREATE_SERVER_PORT_DICTIONARY_SQL,
	CH_DICTIONARY_IP_RELATION:            CREATE_IP_RELATION_DICTIONARY_SQL,
	CH_DICTIONARY_LB_LISTENER:            CREATE_LB_LISTENER_DICTIONARY_SQL,
	CH_DICTIONARY_POD_INGRESS:            CREATE_POD_INGRESS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_K8S_LABEL:          CREATE_K8S_LABEL_DICTIONARY_SQL,
	CH_DICTIONARY_POD_K8S_LABELS:         CREATE_K8S_LABELS_DICTIONARY_SQL,
	CH_DICTIONARY_IP_RESOURCE:            CREATE_IP_RESOURCE_DICTIONARY_SQL,
	CH_DICTIONARY_NODE_TYPE:              CREATE_NODE_TYPE_DICTIONARY_SQL,
	CH_STRING_DICTIONARY_ENUM:            CREATE_STRING_ENUM_SQL,
	CH_INT_DICTIONARY_ENUM:               CREATE_INT_ENUM_SQL,
	CH_DICTIONARY_CHOST_CLOUD_TAG:        CREATE_CLOUD_TAG_DICTIONARY_SQL,
	CH_DICTIONARY_POD_NS_CLOUD_TAG:       CREATE_CLOUD_TAG_DICTIONARY_SQL,
	CH_DICTIONARY_CHOST_CLOUD_TAGS:       CREATE_CLOUD_TAGS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_NS_CLOUD_TAGS:      CREATE_CLOUD_TAGS_DICTIONARY_SQL,
	CH_DICTIONARY_OS_APP_TAG:             CREATE_OS_APP_TAG_DICTIONARY_SQL,
	CH_DICTIONARY_OS_APP_TAGS:            CREATE_OS_APP_TAGS_DICTIONARY_SQL,
	CH_DICTIONARY_GPROCESS:               CREATE_GPROCESS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_SERVICE_K8S_LABEL:  CREATE_K8S_LABEL_DICTIONARY_SQL,
	CH_DICTIONARY_POD_SERVICE_K8S_LABELS: CREATE_K8S_LABELS_DICTIONARY_SQL,

	CH_DICTIONARY_POD_K8S_ANNOTATION:          CREATE_K8S_ANNOTATION_DICTIONARY_SQL,
	CH_DICTIONARY_POD_K8S_ANNOTATIONS:         CREATE_K8S_ANNOTATIONS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_SERVICE_K8S_ANNOTATION:  CREATE_K8S_ANNOTATION_DICTIONARY_SQL,
	CH_DICTIONARY_POD_SERVICE_K8S_ANNOTATIONS: CREATE_K8S_ANNOTATIONS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_K8S_ENV:                 CREATE_K8S_ENV_DICTIONARY_SQL,
	CH_DICTIONARY_POD_K8S_ENVS:                CREATE_K8S_ENVS_DICTIONARY_SQL,
	CH_DICTIONARY_POD_SERVICE:                 CREATE_POD_SERVICE_DICTIONARY_SQL,
	CH_DICTIONARY_CHOST:                       CREATE_CHOST_DICTIONARY_SQL,

	CH_DICTIONARY_POLICY:     CREATE_POLICY_DICTIONARY_SQL,
	CH_DICTIONARY_NPB_TUNNEL: CREATE_ID_NAME_DICTIONARY_SQL,

	CH_DICTIONARY_ALARM_POLICY: CREATE_AlARM_POLICY_DICTIONARY_SQL,

	CH_PROMETHEUS_LABEL_NAME:              CREATE_PROMETHEUS_LABEL_NAME_DICTIONARY_SQL,
	CH_PROMETHEUS_METRIC_NAME:             CREATE_PROMETHEUS_LABEL_NAME_DICTIONARY_SQL,
	CH_PROMETHEUS_METRIC_APP_LABEL_LAYOUT: CREATE_PROMETHEUS_METRIC_APP_LABEL_LAYOUT_DICTIONARY_SQL,
	CH_APP_LABEL:                          CREATE_APP_LABEL_SQL,
	CH_TARGET_LABEL:                       CREATE_TARGET_LABEL_SQL,
	CH_PROMETHEUS_TARGET_LABEL_LAYOUT:     CREATE_PROMETHEUS_TARGET_LABEL_LAYOUT_DICTIONARY_SQL,

	CH_APP_LABEL_LIVE_VIEW:    CREATE_APP_LABEL_LIVE_VIEW_SQL,
	CH_TARGET_LABEL_LIVE_VIEW: CREATE_TARGET_LABEL_LIVE_VIEW_SQL,
}
View Source
var DBNodeTypeToResourceType = map[string]string{
	"region":      RESOURCE_TYPE_REGION,
	"az":          RESOURCE_TYPE_AZ,
	"host":        RESOURCE_TYPE_HOST,
	"l3_epc":      RESOURCE_TYPE_VPC,
	"subnet":      RESOURCE_TYPE_VL2,
	"vm":          RESOURCE_TYPE_VM,
	"router":      RESOURCE_TYPE_VGW,
	"dhcp_port":   RESOURCE_TYPE_DHCP_PORT,
	"nat_gateway": RESOURCE_TYPE_NAT_GATEWAY,
	"lb":          RESOURCE_TYPE_LB,
	"redis":       RESOURCE_TYPE_REDIS,
	"rds":         RESOURCE_TYPE_RDS,
	"pod_cluster": RESOURCE_TYPE_POD_CLUSTER,
	"pod_node":    RESOURCE_TYPE_POD_NODE,
	"pod_ns":      RESOURCE_TYPE_POD_NAMESPACE,
	"pod_group":   RESOURCE_TYPE_POD_GROUP,
	"pod_service": RESOURCE_TYPE_POD_SERVICE,
	"pod":         RESOURCE_TYPE_POD,
	"ip":          RESOURCE_TYPE_IP,
	"internet":    RESOURCE_TYPE_INTERNET,
	"gprocess":    RESOURCE_TYPE_GPROCESS,
}
View Source
var DomainToDomainID map[string]int
View Source
var DomainToTeamID map[string]int

icon名称不会重复

View Source
var VTapIDToTeamID map[int]int

Functions

func GetIconInfo

func GetIconInfo(cfg config.ControllerConfig) (map[string]int, map[IconKey]int, error)

subscriber

func GetTeamInfo

func GetTeamInfo(db *mysql.DB)

func GetVTapInterfaces

func GetVTapInterfaces(filter map[string]interface{}, orgID int) ([]model.VTapInterface, error)

func ParseIcon

func ParseIcon(cfg config.ControllerConfig, response *simplejson.Json) (map[string]int, map[IconKey]int, error)

func UpdateIconInfo

func UpdateIconInfo(cfg config.ControllerConfig) (map[string]int, map[IconKey]int, error)

timing

Types

type ChAPPLabel

func NewChAPPLabel

func NewChAPPLabel() *ChAPPLabel

type ChAZ

type ChAZ struct {
	SubscriberComponent[*message.AZFieldsUpdate, message.AZFieldsUpdate, mysql.AZ, mysql.ChAZ, IDKey]
	// contains filtered or unexported fields
}

func NewChAZ

func NewChAZ(domainLcuuidToIconID map[string]int, resourceTypeToIconID map[IconKey]int) *ChAZ

type ChAlarmPolicy

type ChAlarmPolicy struct {
	UpdaterComponent[mysql.ChAlarmPolicy, IDKey]
}

func NewChAlarmPolicy

func NewChAlarmPolicy() *ChAlarmPolicy

type ChDHCPPortDevice

type ChDHCPPortDevice struct {
	SubscriberComponent[*message.DHCPPortFieldsUpdate, message.DHCPPortFieldsUpdate, mysql.DHCPPort, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChDHCPPortDevice

func NewChDHCPPortDevice(resourceTypeToIconID map[IconKey]int) *ChDHCPPortDevice

type ChGProcess

type ChGProcess struct {
	SubscriberComponent[*message.ProcessFieldsUpdate, message.ProcessFieldsUpdate, mysql.Process, mysql.ChGProcess, IDKey]
	// contains filtered or unexported fields
}

func NewChGProcess

func NewChGProcess(resourceTypeToIconID map[IconKey]int) *ChGProcess

type ChHostDevice

type ChHostDevice struct {
	SubscriberComponent[*message.HostFieldsUpdate, message.HostFieldsUpdate, mysql.Host, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChHostDevice

func NewChHostDevice(resourceTypeToIconID map[IconKey]int) *ChHostDevice

type ChIPRelation

type ChIPRelation struct {
	UpdaterComponent[mysql.ChIPRelation, IPRelationKey]
}

以VPCID和IP为key,获取IP关联的NAT网关、负载均衡、负载均衡监听器、容器Ingress和容器服务数据

func NewChIPRelation

func NewChIPRelation() *ChIPRelation

type ChIPResource

type ChIPResource struct {
	UpdaterComponent[mysql.ChIPResource, IPResourceKey]
	// contains filtered or unexported fields
}

func NewChIPResource

func NewChIPResource(ctx context.Context) *ChIPResource

type ChIntEnum

type ChIntEnum struct {
	UpdaterComponent[mysql.ChIntEnum, IntEnumTagKey]
}

func NewChIntEnum

func NewChIntEnum() *ChIntEnum

type ChLBDevice

type ChLBDevice struct {
	SubscriberComponent[*message.LBFieldsUpdate, message.LBFieldsUpdate, mysql.LB, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChLBDevice

func NewChLBDevice(resourceTypeToIconID map[IconKey]int) *ChLBDevice

type ChLbListener

type ChLbListener struct {
	UpdaterComponent[mysql.ChLBListener, IDKey]
	// contains filtered or unexported fields
}

func NewChLbListener

func NewChLbListener(resourceTypeToIconID map[IconKey]int) *ChLbListener

type ChNATGatewayDevice

type ChNATGatewayDevice struct {
	SubscriberComponent[*message.NATGatewayFieldsUpdate, message.NATGatewayFieldsUpdate, mysql.NATGateway, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChNATGatewayDevice

func NewChNATGatewayDevice(resourceTypeToIconID map[IconKey]int) *ChNATGatewayDevice

type ChNetwork

type ChNetwork struct {
	SubscriberComponent[*message.NetworkFieldsUpdate, message.NetworkFieldsUpdate, mysql.Network, mysql.ChNetwork, IDKey]
	// contains filtered or unexported fields
}

func NewChNetwork

func NewChNetwork(resourceTypeToIconID map[IconKey]int) *ChNetwork

type ChNodeType

type ChNodeType struct {
	UpdaterComponent[mysql.ChNodeType, NodeTypeKey]
}

func NewChNodeType

func NewChNodeType() *ChNodeType

type ChNpbTunnel

type ChNpbTunnel struct {
	UpdaterComponent[mysql.ChNpbTunnel, IDKey]
}

func NewChNpbTunnel

func NewChNpbTunnel() *ChNpbTunnel

type ChPod

type ChPod struct {
	SubscriberComponent[*message.PodFieldsUpdate, message.PodFieldsUpdate, mysql.Pod, mysql.ChPod, IDKey]
	// contains filtered or unexported fields
}

func NewChPod

func NewChPod(resourceTypeToIconID map[IconKey]int) *ChPod

type ChPodCluster

type ChPodCluster struct {
	SubscriberComponent[*message.PodClusterFieldsUpdate, message.PodClusterFieldsUpdate, mysql.PodCluster, mysql.ChPodCluster, IDKey]
	// contains filtered or unexported fields
}

func NewChPodCluster

func NewChPodCluster(resourceTypeToIconID map[IconKey]int) *ChPodCluster

type ChPodDevice

type ChPodDevice struct {
	SubscriberComponent[*message.PodFieldsUpdate, message.PodFieldsUpdate, mysql.Pod, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChPodDevice

func NewChPodDevice(resourceTypeToIconID map[IconKey]int) *ChPodDevice

type ChPodGroup

type ChPodGroup struct {
	SubscriberComponent[*message.PodGroupFieldsUpdate, message.PodGroupFieldsUpdate, mysql.PodGroup, mysql.ChPodGroup, IDKey]
	// contains filtered or unexported fields
}

func NewChPodGroup

func NewChPodGroup(resourceTypeToIconID map[IconKey]int) *ChPodGroup

type ChPodGroupDevice

type ChPodGroupDevice struct {
	SubscriberComponent[*message.PodGroupFieldsUpdate, message.PodGroupFieldsUpdate, mysql.PodGroup, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChPodGroupDevice

func NewChPodGroupDevice(resourceTypeToIconID map[IconKey]int) *ChPodGroupDevice

type ChPodNamespace

type ChPodNamespace struct {
	SubscriberComponent[*message.PodNamespaceFieldsUpdate, message.PodNamespaceFieldsUpdate, mysql.PodNamespace, mysql.ChPodNamespace, IDKey]
	// contains filtered or unexported fields
}

func NewChPodNamespace

func NewChPodNamespace(resourceTypeToIconID map[IconKey]int) *ChPodNamespace

type ChPodNode

type ChPodNode struct {
	SubscriberComponent[*message.PodNodeFieldsUpdate, message.PodNodeFieldsUpdate, mysql.PodNode, mysql.ChPodNode, IDKey]
	// contains filtered or unexported fields
}

func NewChPodNode

func NewChPodNode(resourceTypeToIconID map[IconKey]int) *ChPodNode

type ChPodNodeDevice

type ChPodNodeDevice struct {
	SubscriberComponent[*message.PodNodeFieldsUpdate, message.PodNodeFieldsUpdate, mysql.PodNode, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChPodNodeDevice

func NewChPodNodeDevice(resourceTypeToIconID map[IconKey]int) *ChPodNodeDevice

type ChPodServiceDevice

type ChPodServiceDevice struct {
	SubscriberComponent[*message.PodServiceFieldsUpdate, message.PodServiceFieldsUpdate, mysql.PodService, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChPodServiceDevice

func NewChPodServiceDevice(resourceTypeToIconID map[IconKey]int) *ChPodServiceDevice

type ChPolicy

type ChPolicy struct {
	UpdaterComponent[mysql.ChPolicy, PolicyKey]
}

func NewChPolicy

func NewChPolicy() *ChPolicy

type ChProcessDevice

type ChProcessDevice struct {
	SubscriberComponent[*message.ProcessFieldsUpdate, message.ProcessFieldsUpdate, mysql.Process, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChProcessDevice

func NewChProcessDevice(resourceTypeToIconID map[IconKey]int) *ChProcessDevice

type ChPrometheusLabelName

type ChPrometheusLabelName struct {
	UpdaterComponent[mysql.ChPrometheusLabelName, IDKey]
}

func NewChPrometheusLabelName

func NewChPrometheusLabelName() *ChPrometheusLabelName

type ChPrometheusMetricAPPLabelLayout

type ChPrometheusMetricAPPLabelLayout struct {
	UpdaterComponent[mysql.ChPrometheusMetricAPPLabelLayout, IDKey]
}

func NewChPrometheusMetricAPPLabelLayout

func NewChPrometheusMetricAPPLabelLayout() *ChPrometheusMetricAPPLabelLayout

type ChPrometheusMetricName

type ChPrometheusMetricName struct {
	UpdaterComponent[mysql.ChPrometheusMetricName, IDKey]
}

func NewChPrometheusMetricNames

func NewChPrometheusMetricNames() *ChPrometheusMetricName

type ChPrometheusTargetLabelLayout

type ChPrometheusTargetLabelLayout struct {
	UpdaterComponent[mysql.ChPrometheusTargetLabelLayout, IDKey]
}

func NewChPrometheusTargetLabelLayout

func NewChPrometheusTargetLabelLayout() *ChPrometheusTargetLabelLayout

type ChRDSInstanceDevice

type ChRDSInstanceDevice struct {
	SubscriberComponent[*message.RDSInstanceFieldsUpdate, message.RDSInstanceFieldsUpdate, mysql.RDSInstance, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChRDSInstanceDevice

func NewChRDSInstanceDevice(resourceTypeToIconID map[IconKey]int) *ChRDSInstanceDevice

type ChRedisInstanceDevice

type ChRedisInstanceDevice struct {
	SubscriberComponent[*message.RedisInstanceFieldsUpdate, message.RedisInstanceFieldsUpdate, mysql.RedisInstance, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChRedisInstanceDevice

func NewChRedisInstanceDevice(resourceTypeToIconID map[IconKey]int) *ChRedisInstanceDevice

type ChRegion

type ChRegion struct {
	UpdaterComponent[mysql.ChRegion, IDKey]
	// contains filtered or unexported fields
}

func NewChRegion

func NewChRegion(domainLcuuidToIconID map[string]int, resourceTypeToIconID map[IconKey]int) *ChRegion

type ChStringEnum

type ChStringEnum struct {
	UpdaterComponent[mysql.ChStringEnum, StringEnumTagKey]
}

func NewChStringEnum

func NewChStringEnum() *ChStringEnum

type ChTapType

type ChTapType struct {
	UpdaterComponent[mysql.ChTapType, TapTypeKey]
	// contains filtered or unexported fields
}

func NewChTapType

func NewChTapType(resourceTypeToIconID map[IconKey]int) *ChTapType

type ChTargetLabel

func NewChTargetLabel

func NewChTargetLabel() *ChTargetLabel

type ChVMDevice

type ChVMDevice struct {
	SubscriberComponent[*message.VMFieldsUpdate, message.VMFieldsUpdate, mysql.VM, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChVMDevice

func NewChVMDevice(resourceTypeToIconID map[IconKey]int) *ChVMDevice

type ChVPC

type ChVPC struct {
	SubscriberComponent[*message.VPCFieldsUpdate, message.VPCFieldsUpdate, mysql.VPC, mysql.ChVPC, IDKey]
	// contains filtered or unexported fields
}

func NewChVPC

func NewChVPC(resourceTypeToIconID map[IconKey]int) *ChVPC

type ChVRouterDevice

type ChVRouterDevice struct {
	SubscriberComponent[*message.VRouterFieldsUpdate, message.VRouterFieldsUpdate, mysql.VRouter, mysql.ChDevice, DeviceKey]
	// contains filtered or unexported fields
}

func NewChVRouterDevice

func NewChVRouterDevice(resourceTypeToIconID map[IconKey]int) *ChVRouterDevice

type ChVTap

type ChVTap struct {
	UpdaterComponent[mysql.ChVTap, IDKey]
	// contains filtered or unexported fields
}

func NewChVTap

func NewChVTap(resourceTypeToIconID map[IconKey]int) *ChVTap

type ChVTapPort

type ChVTapPort struct {
	UpdaterComponent[mysql.ChVTapPort, VtapPortKey]
}

func NewChVTapPort

func NewChVTapPort() *ChVTapPort

type CloudTagKey

type CloudTagKey struct {
	ID  int
	Key string
}

type CloudTagsKey

type CloudTagsKey struct {
	ID int
}

type DeviceInfo

type DeviceInfo struct {
	DeviceID   int
	DeviceType int
	DeviceName string
	IconID     int
	TeamID     int
}

type DeviceKey

type DeviceKey struct {
	DeviceID   int
	DeviceType int
}

type Dictionary

type Dictionary struct {
	// contains filtered or unexported fields
}

func GetDictionary

func GetDictionary() *Dictionary

func (*Dictionary) Init

func (c *Dictionary) Init(cfg config.ControllerConfig)

func (*Dictionary) Start

func (c *Dictionary) Start()

func (*Dictionary) Update

func (c *Dictionary) Update()

type IDKey

type IDKey struct {
	ID int
}

type IPRelationKey

type IPRelationKey struct {
	L3EPCID int
	IP      string
}

type IPResourceKey

type IPResourceKey struct {
	IP       string
	SubnetID int
}

type IconData

type IconData struct {
	ID   int
	Name string
}

type IconKey

type IconKey struct {
	NodeType string
	SubType  int
}

type IntEnumTagKey

type IntEnumTagKey struct {
	TagName  string
	TagValue int
}

type K8sAnnotationKey

type K8sAnnotationKey struct {
	ID  int
	Key string
}

type K8sAnnotationsKey

type K8sAnnotationsKey struct {
	ID int
}

type K8sEnvKey

type K8sEnvKey struct {
	ID  int
	Key string
}

type K8sEnvsKey

type K8sEnvsKey struct {
	ID int
}

type K8sLabelKey

type K8sLabelKey struct {
	ID  int
	Key string
}

type K8sLabelsKey

type K8sLabelsKey struct {
	ID int
}

type NodeTypeKey

type NodeTypeKey struct {
	ResourceType int
}

type OSAPPTagKey

type OSAPPTagKey struct {
	PID int
	Key string
}

type OSAPPTagsKey

type OSAPPTagsKey struct {
	PID int
}

type PolicyKey

type PolicyKey struct {
	ACLGID     int
	TunnelType int
}

type PortDeviceKey

type PortDeviceKey struct {
	DeviceID   int
	DeviceType int
	Protocol   int
	Port       int
}

type PortIDKey

type PortIDKey struct {
	ID       int
	Protocol int
	Port     int
}

type PortIPKey

type PortIPKey struct {
	IP       string
	SubnetID int
	Protocol int
	Port     int
}

type PrometheusAPPLabelKey

type PrometheusAPPLabelKey struct {
	LabelNameID  int
	LabelValueID int
}

type PrometheusTargetLabelKey

type PrometheusTargetLabelKey struct {
	MetricID    int
	LabelNameID int
	TargetID    int
}

type StringEnumTagKey

type StringEnumTagKey struct {
	TagName  string
	TagValue string
}

type Subscriber

type Subscriber interface {
	Subscribe()
	SetConfig(config.ControllerConfig)
	Check() error
	GetSubResourceType() string
	pubsub.ResourceBatchAddedSubscriber
	pubsub.ResourceUpdatedSubscriber
	pubsub.ResourceBatchDeletedSubscriber
	OnDomainDeleted(md *message.Metadata)
}

type SubscriberComponent

type SubscriberComponent[MUPT msgconstraint.FieldsUpdatePtr[MUT], MUT msgconstraint.FieldsUpdate, MT constraint.MySQLModel, CT MySQLChModel, KT ChModelKey] struct {
	// contains filtered or unexported fields
}

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) Check

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) Check() error

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) GetSubResourceType

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) GetSubResourceType() string

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnDomainDeleted

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnDomainDeleted(md *message.Metadata)

Delete resource by domain

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnResourceBatchAdded

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnResourceBatchAdded(md *message.Metadata, msg interface{})

OnResourceBatchAdded implements interface Subscriber in recorder/pubsub/subscriber.go

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnResourceBatchDeleted

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnResourceBatchDeleted(md *message.Metadata, msg interface{}, softDelete bool)

OnResourceBatchDeleted implements interface Subscriber in recorder/pubsub/subscriber.go

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnResourceUpdated

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) OnResourceUpdated(md *message.Metadata, msg interface{})

OnResourceBatchUpdated implements interface Subscriber in recorder/pubsub/subscriber.go

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) SetConfig

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) SetConfig(cfg config.ControllerConfig)

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) SetIconInfo

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) SetIconInfo(domainLcuuidToIconID map[string]int, resourceTypeToIconID map[IconKey]int)

func (*SubscriberComponent[MUPT, MUT, MT, CT, KT]) Subscribe

func (s *SubscriberComponent[MUPT, MUT, MT, CT, KT]) Subscribe()

type SubscriberDataGenerator

type SubscriberDataGenerator[MUPT msgconstraint.FieldsUpdatePtr[MUT], MUT msgconstraint.FieldsUpdate, MT constraint.MySQLModel, CT MySQLChModel, KT ChModelKey] interface {
	// contains filtered or unexported methods
}

type SubscriberManager

type SubscriberManager struct {
	// contains filtered or unexported fields
}

func GetSubscriberManager

func GetSubscriberManager() *SubscriberManager

func (*SubscriberManager) GetSubscribers

func (m *SubscriberManager) GetSubscribers(subResourceType string) []Subscriber

func (*SubscriberManager) HealthCheck

func (c *SubscriberManager) HealthCheck()

func (*SubscriberManager) Init

func (*SubscriberManager) Start

func (c *SubscriberManager) Start() (err error)

type TagRecorder

type TagRecorder struct {
	Dictionary        *Dictionary        // run in master controller of all regions
	UpdaterManager    *UpdaterManager    // run in master controller of master region
	SubscriberManager *SubscriberManager // run in all controllers of all regions
}

func GetSingleton

func GetSingleton() *TagRecorder

func (*TagRecorder) Init

type TapTypeKey

type TapTypeKey struct {
	Value int
}

type Updater

type Updater interface {
	// 刷新ch资源入口
	// 基于资源基础数据,构建新的ch数据
	// 直接查询ch表,构建旧的ch数据
	// 遍历新的ch数据,若key不在旧的ch数据中,则新增;否则检查是否有更新,若有更新,则更新
	// 遍历旧的ch数据,若key不在新的ch数据中,则删除
	Refresh() bool
	SetConfig(cfg config.ControllerConfig)
}

type UpdaterComponent

type UpdaterComponent[MT MySQLChModel, KT ChModelKey] struct {
	// contains filtered or unexported fields
}

func (*UpdaterComponent[MT, KT]) Refresh

func (b *UpdaterComponent[MT, KT]) Refresh() bool

func (*UpdaterComponent[MT, KT]) SetConfig

func (b *UpdaterComponent[MT, KT]) SetConfig(cfg config.ControllerConfig)

type UpdaterManager

type UpdaterManager struct {
	// contains filtered or unexported fields
}

func GetUpdaterManager

func GetUpdaterManager() *UpdaterManager

func (*UpdaterManager) Init

func (*UpdaterManager) Start

func (c *UpdaterManager) Start()

func (*UpdaterManager) Stop

func (t *UpdaterManager) Stop()

type VtapPortKey

type VtapPortKey struct {
	VtapID  int
	TapPort int64
}

Directories

Path Synopsis
tagrecorder包中使用到的泛型约束
tagrecorder包中使用到的泛型约束

Jump to

Keyboard shortcuts

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