Skip to content

Commit 971bb93

Browse files
committed
Begin to add tag support with default tags in provider config
1 parent 7c67172 commit 971bb93

22 files changed

+137
-47
lines changed

konnect/client/client.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,22 @@ type EntityId struct {
3636
}
3737

3838
type Client struct {
39-
pat string
40-
region string
41-
numRetries int
42-
retryDelay int
43-
httpClient *http.Client
39+
pat string
40+
region string
41+
numRetries int
42+
retryDelay int
43+
DefaultTags []string
44+
httpClient *http.Client
4445
}
4546

46-
func NewClient(pat string, region string, numRetries int, retryDelay int) (*Client, error) {
47+
func NewClient(pat string, region string, numRetries int, retryDelay int, defaultTags []string) (*Client, error) {
4748
c := &Client{
48-
pat: pat,
49-
region: region,
50-
numRetries: numRetries,
51-
retryDelay: retryDelay,
52-
httpClient: &http.Client{},
49+
pat: pat,
50+
region: region,
51+
numRetries: numRetries,
52+
retryDelay: retryDelay,
53+
DefaultTags: defaultTags,
54+
httpClient: &http.Client{},
5355
}
5456
return c, nil
5557
}

konnect/client/consumer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ func ConsumerDecodeId(s string) (string, string) {
2525
tokens := strings.Split(s, IdSeparator)
2626
return tokens[0], tokens[1]
2727
}
28+
29+
//TAGS

konnect/client/consumer_acl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ func ConsumerACLDecodeId(s string) (string, string, string) {
2222
tokens := strings.Split(s, IdSeparator)
2323
return tokens[0], tokens[1], tokens[2]
2424
}
25+
26+
//TAGS

konnect/client/consumer_basic.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ func ConsumerBasicDecodeId(s string) (string, string, string) {
2424
tokens := strings.Split(s, IdSeparator)
2525
return tokens[0], tokens[1], tokens[2]
2626
}
27+
28+
//TAGS

konnect/client/consumer_hmac.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ func ConsumerHMACDecodeId(s string) (string, string, string) {
2323
tokens := strings.Split(s, IdSeparator)
2424
return tokens[0], tokens[1], tokens[2]
2525
}
26+
27+
//TAGS

konnect/client/consumer_jwt.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ func ConsumerJWTDecodeId(s string) (string, string, string) {
2525
tokens := strings.Split(s, IdSeparator)
2626
return tokens[0], tokens[1], tokens[2]
2727
}
28+
29+
//TAGS

konnect/client/consumer_key.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ func ConsumerKeyDecodeId(s string) (string, string, string) {
2222
tokens := strings.Split(s, IdSeparator)
2323
return tokens[0], tokens[1], tokens[2]
2424
}
25+
26+
//TAGS

konnect/client/control_plane.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ type ControlPlaneConfig struct {
1919
type ControlPlaneCollection struct {
2020
ControlPlanes []ControlPlane `json:"data"`
2121
}
22+
23+
//LABELS

konnect/client/plugin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ func PluginDecodeId(s string) (string, string) {
4242
tokens := strings.Split(s, IdSeparator)
4343
return tokens[0], tokens[1]
4444
}
45+
46+
//TAGS

konnect/client/route.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ func RouteDecodeId(s string) (string, string) {
3737
tokens := strings.Split(s, IdSeparator)
3838
return tokens[0], tokens[1]
3939
}
40+
41+
//TAGS

0 commit comments

Comments
 (0)