File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 55.history /
66.devcontainer
77* .vsix
8+ * .swp
89
910
1011* .exe
Original file line number Diff line number Diff line change @@ -59,6 +59,26 @@ func (c *Consumer) ToRaw(raw *rawtopic.Consumer) {
5959 raw .Attributes = c .Attributes
6060}
6161
62+ // FromRaw
63+ //
64+ // # Experimental
65+ //
66+ // Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
67+ func (c * Consumer ) FromRaw (raw * rawtopic.Consumer ) {
68+ c .Attributes = raw .Attributes
69+ c .Important = raw .Important
70+ c .Name = raw .Name
71+
72+ c .SupportedCodecs = make ([]Codec , len (raw .SupportedCodecs ))
73+ for index , codec := range raw .SupportedCodecs {
74+ c .SupportedCodecs [index ] = codec
75+ }
76+
77+ if ! raw .ReadFrom .IsZero () {
78+ c .ReadFrom = raw .ReadFrom .Value
79+ }
80+ }
81+
6282// PartitionSettings
6383//
6484// # Experimental
@@ -108,4 +128,9 @@ type TopicDescription struct {
108128func (d * TopicDescription ) FromRaw (raw * rawtopic.DescribeTopicResult ) {
109129 d .Path = raw .Self .Name
110130 d .PartitionSettings .FromRaw (& raw .PartitioningSettings )
131+
132+ d .Consumers = make ([]Consumer , len (raw .Consumers ))
133+ for i := 0 ; i < raw .Consumers ; i ++ {
134+ d .Consumers [i ].FromRaw (& raw .Consumers [i ])
135+ }
111136}
You can’t perform that action at this time.
0 commit comments