common

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SUCCESS                         = "SUCCESS"
	FAIL                            = "FAIL"
	INVALID_PARAMETERS              = "INVALID_PARAMETERS"
	RESOURCE_NOT_FOUND              = "RESOURCE_NOT_FOUND"
	RESOURCE_ALREADY_EXIST          = "RESOURCE_ALREADY_EXIST"
	PARAMETER_ILLEGAL               = "PARAMETER_ILLEGAL"
	INVALID_POST_DATA               = "INVALID_POST_DATA"
	SERVER_ERROR                    = "SERVER_ERROR"
	RESOURCE_NUM_EXCEEDED           = "RESOURCE_NUM_EXCEEDED"
	SELECTED_RESOURCES_NUM_EXCEEDED = "SELECTED_RESOURCES_NUM_EXCEEDED"
)
View Source
const (
	HOST_HOSTNAME     = "host_hostname"
	HOST_IP           = "host_ip"
	CHOST_HOSTNAME    = "chost_hostname"
	CHOST_IP          = "chost_ip"
	POD_NODE_HOSTNAME = "pod_node_hostname"
	POD_NODE_IP       = "pod_node_ip"

	TAP_PORT_HOST        = "tap_port_host"
	TAP_PORT_CHOST       = "tap_port_chost"
	TAP_PORT_POD_NODE    = "tap_port_pod_node"
	CAPTURE_NIC_HOST     = "capture_nic_host"
	CAPTURE_NIC_CHOST    = "capture_nic_chost"
	CAPTURE_NIC_POD_NODE = "capture_nic_pod_node"
)
View Source
const (
	HEADER_KEY_X_ORG_ID = "X-Org-Id"
	DEFAULT_ORG_ID      = "1"
)
View Source
const (
	COLUMN_SCHEMA_TYPE_TAG = iota
	COLUMN_SCHEMA_TYPE_METRICS
)
View Source
const NO_LIMIT = "-1"

Variables

View Source
var PEER_TABLES = []string{"l4_flow_log", "l7_flow_log", "application_map", "network_map", "vtap_flow_edge_port", "vtap_app_edge_port"}
View Source
var TRANS_MAP_ITEM_TAG = map[string]string{
	"k8s.label.":      "k8s_label",
	"k8s.annotation.": "k8s_annotation",
	"k8s.env.":        "k8s_env",
	"cloud.tag.":      "cloud_tag",
	"os.app.":         "os_app",
}

Functions

func IsValueInSliceString

func IsValueInSliceString(value string, list []string) bool

func LoadDbDescriptions

func LoadDbDescriptions(dir string) (map[string]interface{}, error)

func NewError

func NewError(status string, message string) error

func TransMapItem

func TransMapItem(name, table string) (nameNoPreffix string, nameNoSuffix string, transKey string)

Types

type ColumnSchema

type ColumnSchema struct {
	Name      string
	Unit      string
	Type      int
	ValueType string
	PreAS     string
	LabelType string
}

func NewColumnSchema

func NewColumnSchema(name, preAS, labelType string) *ColumnSchema

func (*ColumnSchema) ToMap

func (c *ColumnSchema) ToMap() map[string]interface{}

type ColumnSchemas

type ColumnSchemas []*ColumnSchema

func (*ColumnSchemas) ToArray

func (c *ColumnSchemas) ToArray() []interface{}

type EntryKey

type EntryKey struct {
	ORGID  string
	Filter string
}

type EntryValue

type EntryValue struct {
	Filter string
	Time   time.Time
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type QuerierParams

type QuerierParams struct {
	Debug         string
	UseQueryCache bool
	QueryCacheTTL string
	QueryUUID     string
	DB            string
	Sql           string
	DataSource    string
	Context       context.Context
	NoPreWhere    bool
	ORGID         string
	SimpleSql     bool
}

type Result

type Result struct {
	Columns []interface{}
	Values  []interface{}
	Schemas ColumnSchemas
}

func (*Result) ToJson

func (r *Result) ToJson() map[string]interface{}

type ServiceError

type ServiceError struct {
	Status  string
	Message string
}

func (*ServiceError) Error

func (e *ServiceError) Error() string

type TempoParams

type TempoParams struct {
	TraceId     string
	StartTime   string
	EndTime     string
	TagName     string
	MinDuration string
	MaxDuration string
	Limit       string
	Debug       string
	Filters     []*KeyValue
	Context     context.Context
}

func (*TempoParams) SetFilters

func (p *TempoParams) SetFilters(filterStr string)

Jump to

Keyboard shortcuts

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