Documentation ¶
Index ¶
- Constants
- Variables
- func BrokersFromModelList(Brokers List, dd diag.Diagnostics) ([]map[string]any, diag.Diagnostics)
- func BrokersToModelList(elementType attr.Type, brokers []interface{}) List
- func FindKey[K comparable, V comparable](m map[K]V, value V) K
- func GetAttributeValue[T any](m map[string]attr.Value, name string) T
- func Json(label string, obj any) string
- func KafkaDestinationSASLToModel(types map[string]attr.Type, user_config map[string]interface{}) basetypes.ObjectValue
- func MapAnyFillMissingValues(attrs map[string]attr.Type, values map[string]any, optional_fields []string) map[string]attr.Value
- func MapAnyToMapValues(values map[string]any) map[string]attr.Value
- func MapKeys[K comparable, V any](m map[K]V) []K
- func MapValuesToMapAny(obj interface{}, dd *diag.Diagnostics) map[string]any
- func ParentConditionalAttribute(operators []string) schema.SingleNestedAttribute
- func PopulateMissingMapValues(attrs map[string]attr.Type, result map[string]attr.Value)
- func SetOptionalAttributeStringFromMap(target map[string]attr.Value, source map[string]any, names ...string)
- func SetOptionalStringFromAttributeMap(target map[string]any, attr_source_map map[string]attr.Value, names ...string)
- func SliceToStringListValue[T any](s []T) List
- func StringListValueToStringSlice(list List) []string
- func ToAttrTypes(attributes map[string]schema.Attribute) map[string]attr.Type
- func UnwindConditionalFromModel(v attr.Value) map[string]any
- func UnwindConditionalToModel(component map[string]any, operators []string) ObjectValue
Constants ¶
const VRL_PARSER_APACHE = "apache_log"
const VRL_PARSER_CEF = "cef_log"
const VRL_PARSER_CSV = "csv_row"
const VRL_PARSER_GROK = "grok_parser"
const VRL_PARSER_KEY_VALUE = "key_value_log"
const VRL_PARSER_NGINX = "nginx_log"
const VRL_PARSER_REGEX = "regex_parser"
const VRL_PARSER_TIMESTAMP = "timestamp_parser"
Variables ¶
var APACHE_LOG_FORMATS = append(NGINX_LOG_FORMATS, "common")
var Aggregate_Operations = map[string]string{
"add": "DEFAULT",
"sum": "SUM",
"minimum": "MIN",
"maximum": "MAX",
"average": "AVG",
"set_intersection": "SET_INTERSECTION",
"distribution_concatenation": "DIST_CONCAT",
"custom": "CUSTOM",
}
var Change_Operator_Labels = []string{
"percent_change_greater",
"percent_change_greater_or_equal",
"percent_change_less",
"percent_change_less_or_equal",
"value_change_greater",
"value_change_greater_or_equal",
"value_change_less",
"value_change_less_or_equal",
}
var EncryptionAlgorithms = []string{
"AES-256-CFB",
"AES-192-CFB",
"AES-128-CFB",
"AES-256-OFB",
"AES-192-OFB",
"AES-128-OFB",
"AES-256-CTR",
"AES-192-CTR",
"AES-128-CTR",
"AES-256-CBC-PKCS7",
"AES-192-CBC-PKCS7",
"AES-128-CBC-PKCS7",
"AES-256-CBC-ANSIX923",
"AES-192-CBC-ANSIX923",
"AES-128-CBC-ANSIX923",
"AES-256-CBC-ISO7816",
"AES-192-CBC-ISO7816",
"AES-128-CBC-ISO7816",
"AES-256-CBC-ISO10126",
"AES-192-CBC-ISO10126",
"AES-128-CBC-ISO10126",
}
var ExpressionTypes = map[string]attr.Type{
"field": StringType{},
"operator": StringType{},
"value_number": Float64Type{},
"value_string": StringType{},
"negate": BoolType{},
}
var LimitExceedAction = []string{
"drop_tag",
"drop_event",
}
var LogicalOperationAttribute = schema.StringAttribute{ Optional: true, Computed: true, Description: "The logical operation (AND/OR) to be applied to the list of conditionals", Validators: []validator.String{ stringvalidator.OneOf("AND", "OR"), }, }
var MAX_NESTED_LEVELS = 5
var MetricKind = []string{
"incremental",
"absolute",
}
var MetricType = []string{
"counter",
"sum",
"gauge",
}
var NGINX_LOG_FORMATS = []string{"combined", "error"}
var Non_Change_Operator_Labels = []string{
"contains",
"ends_with",
"equal",
"exists",
"greater",
"greater_or_equal",
"is_array",
"is_boolean",
"is_empty",
"is_ip_in_cidr_range",
"is_metric",
"is_null",
"is_number",
"is_object",
"is_string",
"less",
"less_or_equal",
"regex_match",
"starts_with",
}
var OPTIONAL_FIELDS_BY_PARSER = map[string][]string{
"apache_log": {"timestamp_format", "custom_timestamp_format"},
"csv_row": {"field_names"},
"key_value_log": {"field_delimiter", "key_delimiter"},
"nginx_log": {"timestamp_format", "custom_timestamp_format"},
"timestamp_parser": {"custom_format"},
}
var ReduceMergeStrategies = []string{
"array",
"shortest_array",
"longest_array",
"flat_unique",
"concat",
"concat_newline",
"concat_raw",
"discard",
"retain",
"min",
"max",
"sum",
}
var TagCardinalityMode = []string{
"exact",
"probabilistic",
}
var VRL_PARSERS = map[string]string{
"apache_log": "parse_apache_log",
"aws_alb_log": "parse_aws_alb_log",
"aws_cloudwatch_log": "parse_aws_cloudwatch_log_subscription_message",
"aws_vpc_flow_log": "parse_aws_vpc_flow_log",
"cef_log": "parse_cef",
"common_log": "parse_common_log",
"csv_row": "parse_csv",
"glog": "parse_glog",
"grok_parser": "parse_grok",
"int_parser": "parse_int",
"json_parser": "parse_json",
"key_value_log": "parse_key_value",
"klog": "parse_klog",
"linux_authorization_log": "parse_linux_authorization",
"nginx_log": "parse_nginx_log",
"querystring_parser": "parse_query_string",
"regex_parser": "parse_regex",
"syslog": "parse_syslog",
"timestamp_parser": "parse_timestamp",
"token_parser": "parse_tokens",
"url_parser": "parse_url",
"user_agent_parser": "parse_user_agent",
}
var VRL_PARSERS_WITH_REQUIRED_OPTIONS = []string{
"apache_log",
"grok_parser",
"regex_parser",
"nginx_log",
"timestamp_parser",
}
Functions ¶
func BrokersFromModelList ¶
func BrokersFromModelList(Brokers List, dd diag.Diagnostics) ([]map[string]any, diag.Diagnostics)
Kafka-specific functions, shared between multiple types
func BrokersToModelList ¶
func FindKey ¶
func FindKey[K comparable, V comparable](m map[K]V, value V) K
Returns the key for a given map, panicking when not found
func GetAttributeValue ¶
Gets a known attribute value from an attribute map and casts it to the provided type.
func MapAnyFillMissingValues ¶
func MapAnyFillMissingValues(attrs map[string]attr.Type, values map[string]any, optional_fields []string) map[string]attr.Value
Make a complete map of values, using a null-equivalent for any missing fields
func MapAnyToMapValues ¶
This function can help with taking an object from an API response and translating it into a basetype object from the terraform-plugin-framework
func MapKeys ¶
func MapKeys[K comparable, V any](m map[K]V) []K
Returns the keys of the provided map
func MapValuesToMapAny ¶
func MapValuesToMapAny(obj interface{}, dd *diag.Diagnostics) map[string]any
This function can receive a terraform object (as defined in their basetypes) and return a regular map[string]any object that can be used in `Component` such that it can be used in an API call.
func ParentConditionalAttribute ¶
func ParentConditionalAttribute(operators []string) schema.SingleNestedAttribute
func SetOptionalAttributeStringFromMap ¶
func SetOptionalAttributeStringFromMap(target map[string]attr.Value, source map[string]any, names ...string)
Sets one or more optional string attributes from a source map
func SetOptionalStringFromAttributeMap ¶
func SetOptionalStringFromAttributeMap(target map[string]any, attr_source_map map[string]attr.Value, names ...string)
Sets one or more optional string values from a attribute map into a target map
func SliceToStringListValue ¶
func SliceToStringListValue[T any](s []T) List
func StringListValueToStringSlice ¶
func StringListValueToStringSlice(list List) []string
func ToAttrTypes ¶
Given a map of schema (resource, data, etc) attributes, returns the attribute types
Types ¶
This section is empty.