map.go
map.go - Overview
This file provides functionality to build ClickHouse queries for the service map based on provided tags.
Detailed Documentation
BuildServiceMapQuery(tags []model.TagQuery) (string, []interface{})
func BuildServiceMapQuery(tags []model.TagQuery) (string, []interface{}) { ... }
- Purpose: Constructs a ClickHouse query filter based on the provided tags.
- Parameters:
tags
: A slice ofmodel.TagQuery
structs, each representing a tag to filter by.
- Returns:
string
: A string containing the filter part of the query.[]interface{}
: A slice of interfaces containing the named arguments for the query.
- Parameters:
Code Examples
// Example usage:
tags := []model.TagQuery{
{
Key: "k8s_cluster_name",
Operator: model.InOperator,
Values: []string{"cluster1", "cluster2"},
},
}
query, args := BuildServiceMapQuery(tags)
fmt.Println(query)
fmt.Println(args)
Include in Getting Started: NO