-
Notifications
You must be signed in to change notification settings - Fork 8
/
topic_doc_example.go
52 lines (50 loc) · 1.18 KB
/
topic_doc_example.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package kafka_nais_io_v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
)
func ExampleTopicForDocumentation() *Topic {
return &Topic{
TypeMeta: metav1.TypeMeta{
Kind: "Topic",
APIVersion: "kafka.nais.io/v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "mytopic",
Namespace: "myteam",
Labels: map[string]string{
"team": "myteam",
},
},
Spec: TopicSpec{
Pool: "nav-integration-test",
Config: &Config{
CleanupPolicy: pointer.StringPtr("delete"),
MinimumInSyncReplicas: pointer.IntPtr(2),
Partitions: pointer.IntPtr(1),
Replication: pointer.IntPtr(3),
RetentionBytes: pointer.IntPtr(-1),
RetentionHours: pointer.IntPtr(168),
SegmentHours: pointer.IntPtr(168),
MaxMessageBytes: pointer.IntPtr(1048588),
},
ACL: TopicACLs{
{
Access: "read",
Application: "consumer",
Team: "otherteam",
},
{
Access: "write",
Application: "producer",
Team: "myteam",
},
{
Access: "readwrite",
Application: "processor",
Team: "myteam",
},
},
},
}
}