-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathshared_types.go
28 lines (25 loc) · 1.02 KB
/
shared_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package v1alpha1
// Duration is a string value representing a duration in time.
// Duration can be specified in milliseconds (ms), seconds (s), minutes (m), hours (h).
// A value without a suffix is seconds.
// Examples: 120s, 50ms, 5m, 1h.
//
// +kubebuilder:validation:Pattern=`^[0-9]{1,4}(ms|s|m|h)?$`
type Duration string
// SpanAttribute is a key value pair to be added to a tracing span.
type SpanAttribute struct {
// Key is the key for a span attribute.
// Format: must have all '"' escaped and must not contain any '$' or end with an unescaped '\'
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=255
// +kubebuilder:validation:Pattern=`^([^"$\\]|\\[^$])*$`
Key string `json:"key"`
// Value is the value for a span attribute.
// Format: must have all '"' escaped and must not contain any '$' or end with an unescaped '\'
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=255
// +kubebuilder:validation:Pattern=`^([^"$\\]|\\[^$])*$`
Value string `json:"value"`
}