From 3fe5d05728858405b75cd8fc6e1ed7388c5de86e Mon Sep 17 00:00:00 2001 From: Kobe Yang Date: Wed, 9 Aug 2017 15:20:53 -0700 Subject: [PATCH 1/2] Add options field to cg and destination --- .generated/go/cherami/cherami.go | 676 +++++++++++++------ .generated/go/cherami/tchan-cherami.go | 269 ++++---- .generated/go/controller/tchan-controller.go | 211 +++--- .generated/go/metadata/tchan-metadata.go | 640 ++++++++++-------- .generated/go/replicator/tchan-replicator.go | 394 ++++++----- .generated/go/shared/shared.go | 354 ++++++++-- .generated/go/store/tchan-store.go | 126 ++-- idl/cherami/cherami.thrift | 14 +- idl/cherami_server/shared.thrift | 6 + 9 files changed, 1737 insertions(+), 953 deletions(-) diff --git a/.generated/go/cherami/cherami.go b/.generated/go/cherami/cherami.go index 2b1c776..e2eae1c 100644 --- a/.generated/go/cherami/cherami.go +++ b/.generated/go/cherami/cherami.go @@ -1319,6 +1319,7 @@ func (p *QueueCacheMissError) Error() string { // - SchemaInfo // - KafkaCluster // - KafkaTopics +// - Options type DestinationDescription struct { Path *string `thrift:"path,1" db:"path" json:"path,omitempty"` Type *DestinationType `thrift:"type,2" db:"type" json:"type,omitempty"` @@ -1336,6 +1337,7 @@ type DestinationDescription struct { // unused fields # 21 to 39 KafkaCluster *string `thrift:"kafkaCluster,40" db:"kafkaCluster" json:"kafkaCluster,omitempty"` KafkaTopics []string `thrift:"kafkaTopics,41" db:"kafkaTopics" json:"kafkaTopics,omitempty"` + Options map[string]bool `thrift:"options,42" db:"options" json:"options,omitempty"` } func NewDestinationDescription() *DestinationDescription { @@ -1431,6 +1433,11 @@ var DestinationDescription_KafkaTopics_DEFAULT []string func (p *DestinationDescription) GetKafkaTopics() []string { return p.KafkaTopics } +var DestinationDescription_Options_DEFAULT map[string]bool + +func (p *DestinationDescription) GetOptions() map[string]bool { + return p.Options +} func (p *DestinationDescription) IsSetPath() bool { return p.Path != nil } @@ -1483,6 +1490,10 @@ func (p *DestinationDescription) IsSetKafkaTopics() bool { return p.KafkaTopics != nil } +func (p *DestinationDescription) IsSetOptions() bool { + return p.Options != nil +} + func (p *DestinationDescription) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -1548,6 +1559,10 @@ func (p *DestinationDescription) Read(iprot thrift.TProtocol) error { if err := p.ReadField41(iprot); err != nil { return err } + case 42: + if err := p.ReadField42(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -1694,6 +1709,34 @@ var _elem0 string return nil } +func (p *DestinationDescription) ReadField42(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key1 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} +var _val2 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val2 = v +} + p.Options[_key1] = _val2 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *DestinationDescription) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("DestinationDescription"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -1711,6 +1754,7 @@ func (p *DestinationDescription) Write(oprot thrift.TProtocol) error { if err := p.writeField20(oprot); err != nil { return err } if err := p.writeField40(oprot); err != nil { return err } if err := p.writeField41(oprot); err != nil { return err } + if err := p.writeField42(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -1885,6 +1929,28 @@ func (p *DestinationDescription) writeField41(oprot thrift.TProtocol) (err error return err } +func (p *DestinationDescription) writeField42(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 42); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 42:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 42:options: ", p), err) } + } + return err +} + func (p *DestinationDescription) String() string { if p == nil { return "" @@ -2455,11 +2521,11 @@ func (p *DestinationZoneConfigs) ReadField10(iprot thrift.TProtocol) error { tSlice := make([]*DestinationZoneConfig, 0, size) p.Configs = tSlice for i := 0; i < size; i ++ { - _elem1 := &DestinationZoneConfig{} - if err := _elem1.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + _elem3 := &DestinationZoneConfig{} + if err := _elem3.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) } - p.Configs = append(p.Configs, _elem1) + p.Configs = append(p.Configs, _elem3) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -2830,13 +2896,13 @@ func (p *CreateDestinationRequest) ReadField41(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.KafkaTopics = tSlice for i := 0; i < size; i ++ { -var _elem2 string +var _elem4 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem2 = v + _elem4 = v } - p.KafkaTopics = append(p.KafkaTopics, _elem2) + p.KafkaTopics = append(p.KafkaTopics, _elem4) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3818,13 +3884,13 @@ func (p *ListDestinationsResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*DestinationDescription, 0, size) p.Destinations = tSlice for i := 0; i < size; i ++ { - _elem3 := &DestinationDescription{ + _elem5 := &DestinationDescription{ ChecksumOption: 0, } - if err := _elem3.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + if err := _elem5.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) } - p.Destinations = append(p.Destinations, _elem3) + p.Destinations = append(p.Destinations, _elem5) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3908,6 +3974,8 @@ func (p *ListDestinationsResult_) String() string { // @param skipOlderMessagesInSeconds. This is useful for consumers who always wants to keep up and don't care about // backlog older than certain duration. // @param createdAt. Time when ConsumerGroup was registered. +// @param delaySeconds. This specifies that the consumer-group would like every message to be delivered after the +// specified delay. // // // Attributes: @@ -3926,6 +3994,7 @@ func (p *ListDestinationsResult_) String() string { // - IsMultiZone // - ZoneConfigs // - DelaySeconds +// - Options type ConsumerGroupDescription struct { DestinationPath *string `thrift:"destinationPath,1" db:"destinationPath" json:"destinationPath,omitempty"` ConsumerGroupName *string `thrift:"consumerGroupName,2" db:"consumerGroupName" json:"consumerGroupName,omitempty"` @@ -3943,6 +4012,7 @@ type ConsumerGroupDescription struct { IsMultiZone *bool `thrift:"isMultiZone,20" db:"isMultiZone" json:"isMultiZone,omitempty"` ZoneConfigs *ConsumerGroupZoneConfigs `thrift:"zoneConfigs,21" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,22" db:"delaySeconds" json:"delaySeconds,omitempty"` + Options map[string]bool `thrift:"options,23" db:"options" json:"options,omitempty"` } func NewConsumerGroupDescription() *ConsumerGroupDescription { @@ -4054,6 +4124,11 @@ func (p *ConsumerGroupDescription) GetDelaySeconds() int32 { } return *p.DelaySeconds } +var ConsumerGroupDescription_Options_DEFAULT map[string]bool + +func (p *ConsumerGroupDescription) GetOptions() map[string]bool { + return p.Options +} func (p *ConsumerGroupDescription) IsSetDestinationPath() bool { return p.DestinationPath != nil } @@ -4114,6 +4189,10 @@ func (p *ConsumerGroupDescription) IsSetDelaySeconds() bool { return p.DelaySeconds != nil } +func (p *ConsumerGroupDescription) IsSetOptions() bool { + return p.Options != nil +} + func (p *ConsumerGroupDescription) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -4187,6 +4266,10 @@ func (p *ConsumerGroupDescription) Read(iprot thrift.TProtocol) error { if err := p.ReadField22(iprot); err != nil { return err } + case 23: + if err := p.ReadField23(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -4338,6 +4421,34 @@ func (p *ConsumerGroupDescription) ReadField22(iprot thrift.TProtocol) error { return nil } +func (p *ConsumerGroupDescription) ReadField23(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key6 = v +} +var _val7 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val7 = v +} + p.Options[_key6] = _val7 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *ConsumerGroupDescription) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("ConsumerGroupDescription"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -4357,6 +4468,7 @@ func (p *ConsumerGroupDescription) Write(oprot thrift.TProtocol) error { if err := p.writeField20(oprot); err != nil { return err } if err := p.writeField21(oprot); err != nil { return err } if err := p.writeField22(oprot); err != nil { return err } + if err := p.writeField23(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -4546,6 +4658,28 @@ func (p *ConsumerGroupDescription) writeField22(oprot thrift.TProtocol) (err err return err } +func (p *ConsumerGroupDescription) writeField23(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 23); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 23:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 23:options: ", p), err) } + } + return err +} + func (p *ConsumerGroupDescription) String() string { if p == nil { return "" @@ -4766,11 +4900,11 @@ func (p *ConsumerGroupZoneConfigs) ReadField10(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.Configs = tSlice for i := 0; i < size; i ++ { - _elem4 := &ConsumerGroupZoneConfig{} - if err := _elem4.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + _elem8 := &ConsumerGroupZoneConfig{} + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) } - p.Configs = append(p.Configs, _elem4) + p.Configs = append(p.Configs, _elem8) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4853,6 +4987,7 @@ func (p *ConsumerGroupZoneConfigs) String() string { // - IsMultiZone // - ZoneConfigs // - DelaySeconds +// - Options type CreateConsumerGroupRequest struct { DestinationPath *string `thrift:"destinationPath,1" db:"destinationPath" json:"destinationPath,omitempty"` ConsumerGroupName *string `thrift:"consumerGroupName,2" db:"consumerGroupName" json:"consumerGroupName,omitempty"` @@ -4866,6 +5001,7 @@ type CreateConsumerGroupRequest struct { IsMultiZone *bool `thrift:"isMultiZone,10" db:"isMultiZone" json:"isMultiZone,omitempty"` ZoneConfigs *ConsumerGroupZoneConfigs `thrift:"zoneConfigs,11" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,12" db:"delaySeconds" json:"delaySeconds,omitempty"` + Options map[string]bool `thrift:"options,13" db:"options" json:"options,omitempty"` } func NewCreateConsumerGroupRequest() *CreateConsumerGroupRequest { @@ -4949,6 +5085,11 @@ func (p *CreateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } +var CreateConsumerGroupRequest_Options_DEFAULT map[string]bool + +func (p *CreateConsumerGroupRequest) GetOptions() map[string]bool { + return p.Options +} func (p *CreateConsumerGroupRequest) IsSetDestinationPath() bool { return p.DestinationPath != nil } @@ -4993,6 +5134,10 @@ func (p *CreateConsumerGroupRequest) IsSetDelaySeconds() bool { return p.DelaySeconds != nil } +func (p *CreateConsumerGroupRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *CreateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -5050,6 +5195,10 @@ func (p *CreateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField12(iprot); err != nil { return err } + case 13: + if err := p.ReadField13(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -5164,6 +5313,34 @@ func (p *CreateConsumerGroupRequest) ReadField12(iprot thrift.TProtocol) error return nil } +func (p *CreateConsumerGroupRequest) ReadField13(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key9 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key9 = v +} +var _val10 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val10 = v +} + p.Options[_key9] = _val10 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *CreateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("CreateConsumerGroupRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -5179,6 +5356,7 @@ func (p *CreateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField10(oprot); err != nil { return err } if err := p.writeField11(oprot); err != nil { return err } if err := p.writeField12(oprot); err != nil { return err } + if err := p.writeField13(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -5320,6 +5498,28 @@ func (p *CreateConsumerGroupRequest) writeField12(oprot thrift.TProtocol) (err e return err } +func (p *CreateConsumerGroupRequest) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:options: ", p), err) } + } + return err +} + func (p *CreateConsumerGroupRequest) String() string { if p == nil { return "" @@ -5471,6 +5671,7 @@ func (p *ReadConsumerGroupRequest) String() string { // - ActiveZone // - ZoneConfigs // - DelaySeconds +// - Options type UpdateConsumerGroupRequest struct { DestinationPath *string `thrift:"destinationPath,1" db:"destinationPath" json:"destinationPath,omitempty"` ConsumerGroupName *string `thrift:"consumerGroupName,2" db:"consumerGroupName" json:"consumerGroupName,omitempty"` @@ -5483,6 +5684,7 @@ type UpdateConsumerGroupRequest struct { ActiveZone *string `thrift:"activeZone,9" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs *ConsumerGroupZoneConfigs `thrift:"zoneConfigs,10" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,11" db:"delaySeconds" json:"delaySeconds,omitempty"` + Options map[string]bool `thrift:"options,12" db:"options" json:"options,omitempty"` } func NewUpdateConsumerGroupRequest() *UpdateConsumerGroupRequest { @@ -5559,6 +5761,11 @@ func (p *UpdateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } +var UpdateConsumerGroupRequest_Options_DEFAULT map[string]bool + +func (p *UpdateConsumerGroupRequest) GetOptions() map[string]bool { + return p.Options +} func (p *UpdateConsumerGroupRequest) IsSetDestinationPath() bool { return p.DestinationPath != nil } @@ -5599,6 +5806,10 @@ func (p *UpdateConsumerGroupRequest) IsSetDelaySeconds() bool { return p.DelaySeconds != nil } +func (p *UpdateConsumerGroupRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *UpdateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -5652,6 +5863,10 @@ func (p *UpdateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField11(iprot); err != nil { return err } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -5757,6 +5972,34 @@ func (p *UpdateConsumerGroupRequest) ReadField11(iprot thrift.TProtocol) error return nil } +func (p *UpdateConsumerGroupRequest) ReadField12(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key11 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key11 = v +} +var _val12 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val12 = v +} + p.Options[_key11] = _val12 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *UpdateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("UpdateConsumerGroupRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -5771,6 +6014,7 @@ func (p *UpdateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField9(oprot); err != nil { return err } if err := p.writeField10(oprot); err != nil { return err } if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -5900,6 +6144,28 @@ func (p *UpdateConsumerGroupRequest) writeField11(oprot thrift.TProtocol) (err e return err } +func (p *UpdateConsumerGroupRequest) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:options: ", p), err) } + } + return err +} + func (p *UpdateConsumerGroupRequest) String() string { if p == nil { return "" @@ -6323,11 +6589,11 @@ func (p *ListConsumerGroupResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupDescription, 0, size) p.ConsumerGroups = tSlice for i := 0; i < size; i ++ { - _elem5 := &ConsumerGroupDescription{} - if err := _elem5.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + _elem13 := &ConsumerGroupDescription{} + if err := _elem13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) } - p.ConsumerGroups = append(p.ConsumerGroups, _elem5) + p.ConsumerGroups = append(p.ConsumerGroups, _elem13) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -6901,11 +7167,11 @@ func (p *HostProtocol) ReadField10(iprot thrift.TProtocol) error { tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem6 := &HostAddress{} - if err := _elem6.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + _elem14 := &HostAddress{} + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) } - p.HostAddresses = append(p.HostAddresses, _elem6) + p.HostAddresses = append(p.HostAddresses, _elem14) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7168,11 +7434,11 @@ func (p *ReadDestinationHostsResult_) ReadField1(iprot thrift.TProtocol) error tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem7 := &HostAddress{} - if err := _elem7.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + _elem15 := &HostAddress{} + if err := _elem15.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem15), err) } - p.HostAddresses = append(p.HostAddresses, _elem7) + p.HostAddresses = append(p.HostAddresses, _elem15) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7188,11 +7454,11 @@ func (p *ReadDestinationHostsResult_) ReadField10(iprot thrift.TProtocol) error tSlice := make([]*HostProtocol, 0, size) p.HostProtocols = tSlice for i := 0; i < size; i ++ { - _elem8 := &HostProtocol{} - if err := _elem8.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + _elem16 := &HostProtocol{} + if err := _elem16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) } - p.HostProtocols = append(p.HostProtocols, _elem8) + p.HostProtocols = append(p.HostProtocols, _elem16) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7507,11 +7773,11 @@ func (p *ReadPublisherOptionsResult_) ReadField1(iprot thrift.TProtocol) error tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem9 := &HostAddress{} - if err := _elem9.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + _elem17 := &HostAddress{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) } - p.HostAddresses = append(p.HostAddresses, _elem9) + p.HostAddresses = append(p.HostAddresses, _elem17) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7527,11 +7793,11 @@ func (p *ReadPublisherOptionsResult_) ReadField10(iprot thrift.TProtocol) error tSlice := make([]*HostProtocol, 0, size) p.HostProtocols = tSlice for i := 0; i < size; i ++ { - _elem10 := &HostProtocol{} - if err := _elem10.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + _elem18 := &HostProtocol{} + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) } - p.HostProtocols = append(p.HostProtocols, _elem10) + p.HostProtocols = append(p.HostProtocols, _elem18) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7855,11 +8121,11 @@ func (p *ReadConsumerGroupHostsResult_) ReadField1(iprot thrift.TProtocol) erro tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem11 := &HostAddress{} - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + _elem19 := &HostAddress{} + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) } - p.HostAddresses = append(p.HostAddresses, _elem11) + p.HostAddresses = append(p.HostAddresses, _elem19) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7875,11 +8141,11 @@ func (p *ReadConsumerGroupHostsResult_) ReadField10(iprot thrift.TProtocol) err tSlice := make([]*HostProtocol, 0, size) p.HostProtocols = tSlice for i := 0; i < size; i ++ { - _elem12 := &HostProtocol{} - if err := _elem12.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + _elem20 := &HostProtocol{} + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) } - p.HostProtocols = append(p.HostProtocols, _elem12) + p.HostProtocols = append(p.HostProtocols, _elem20) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8153,19 +8419,19 @@ func (p *PutMessage) ReadField4(iprot thrift.TProtocol) error { tMap := make(map[string]string, size) p.UserContext = tMap for i := 0; i < size; i ++ { -var _key13 string +var _key21 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key13 = v + _key21 = v } -var _val14 string +var _val22 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val14 = v + _val22 = v } - p.UserContext[_key13] = _val14 + p.UserContext[_key21] = _val22 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -8540,19 +8806,19 @@ func (p *PutMessageAck) ReadField5(iprot thrift.TProtocol) error { tMap := make(map[string]string, size) p.UserContext = tMap for i := 0; i < size; i ++ { -var _key15 string +var _key23 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key15 = v + _key23 = v } -var _val16 string +var _val24 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val16 = v + _val24 = v } - p.UserContext[_key15] = _val16 + p.UserContext[_key23] = _val24 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -8796,13 +9062,13 @@ func (p *InvalidAckIdError) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.AckIds = tSlice for i := 0; i < size; i ++ { -var _elem17 string +var _elem25 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem17 = v + _elem25 = v } - p.AckIds = append(p.AckIds, _elem17) + p.AckIds = append(p.AckIds, _elem25) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8818,13 +9084,13 @@ func (p *InvalidAckIdError) ReadField3(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.NackIds = tSlice for i := 0; i < size; i ++ { -var _elem18 string +var _elem26 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem18 = v + _elem26 = v } - p.NackIds = append(p.NackIds, _elem18) + p.NackIds = append(p.NackIds, _elem26) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9232,13 +9498,13 @@ func (p *AckMessagesRequest) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.AckIds = tSlice for i := 0; i < size; i ++ { -var _elem19 string +var _elem27 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem19 = v + _elem27 = v } - p.AckIds = append(p.AckIds, _elem19) + p.AckIds = append(p.AckIds, _elem27) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9254,13 +9520,13 @@ func (p *AckMessagesRequest) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.NackIds = tSlice for i := 0; i < size; i ++ { -var _elem20 string +var _elem28 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem20 = v + _elem28 = v } - p.NackIds = append(p.NackIds, _elem20) + p.NackIds = append(p.NackIds, _elem28) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9586,11 +9852,11 @@ func (p *PutMessageBatchRequest) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]*PutMessage, 0, size) p.Messages = tSlice for i := 0; i < size; i ++ { - _elem21 := &PutMessage{} - if err := _elem21.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + _elem29 := &PutMessage{} + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) } - p.Messages = append(p.Messages, _elem21) + p.Messages = append(p.Messages, _elem29) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9726,11 +9992,11 @@ func (p *PutMessageBatchResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*PutMessageAck, 0, size) p.FailedMessages = tSlice for i := 0; i < size; i ++ { - _elem22 := &PutMessageAck{} - if err := _elem22.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + _elem30 := &PutMessageAck{} + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) } - p.FailedMessages = append(p.FailedMessages, _elem22) + p.FailedMessages = append(p.FailedMessages, _elem30) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9746,11 +10012,11 @@ func (p *PutMessageBatchResult_) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]*PutMessageAck, 0, size) p.SuccessMessages = tSlice for i := 0; i < size; i ++ { - _elem23 := &PutMessageAck{} - if err := _elem23.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + _elem31 := &PutMessageAck{} + if err := _elem31.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) } - p.SuccessMessages = append(p.SuccessMessages, _elem23) + p.SuccessMessages = append(p.SuccessMessages, _elem31) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10091,11 +10357,11 @@ func (p *ReceiveMessageBatchResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerMessage, 0, size) p.Messages = tSlice for i := 0; i < size; i ++ { - _elem24 := &ConsumerMessage{} - if err := _elem24.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + _elem32 := &ConsumerMessage{} + if err := _elem32.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) } - p.Messages = append(p.Messages, _elem24) + p.Messages = append(p.Messages, _elem32) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11040,16 +11306,16 @@ func (p *BFrontendClient) recvHostPort() (value string, err error) { return } if mTypeId == thrift.EXCEPTION { - error25 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error26 error - error26, err = error25.Read(iprot) + error33 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error34 error + error34, err = error33.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error26 + err = error34 return } if mTypeId != thrift.REPLY { @@ -11118,16 +11384,16 @@ func (p *BFrontendClient) recvCreateDestination() (value *DestinationDescription return } if mTypeId == thrift.EXCEPTION { - error27 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error28 error - error28, err = error27.Read(iprot) + error35 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error36 error + error36, err = error35.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error28 + err = error36 return } if mTypeId != thrift.REPLY { @@ -11201,16 +11467,16 @@ func (p *BFrontendClient) recvReadDestination() (value *DestinationDescription, return } if mTypeId == thrift.EXCEPTION { - error29 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error30 error - error30, err = error29.Read(iprot) + error37 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error38 error + error38, err = error37.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error30 + err = error38 return } if mTypeId != thrift.REPLY { @@ -11284,16 +11550,16 @@ func (p *BFrontendClient) recvUpdateDestination() (value *DestinationDescription return } if mTypeId == thrift.EXCEPTION { - error31 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error32 error - error32, err = error31.Read(iprot) + error39 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error40 error + error40, err = error39.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error32 + err = error40 return } if mTypeId != thrift.REPLY { @@ -11367,16 +11633,16 @@ func (p *BFrontendClient) recvDeleteDestination() (err error) { return } if mTypeId == thrift.EXCEPTION { - error33 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error34 error - error34, err = error33.Read(iprot) + error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error42 error + error42, err = error41.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error34 + err = error42 return } if mTypeId != thrift.REPLY { @@ -11449,16 +11715,16 @@ func (p *BFrontendClient) recvListDestinations() (value *ListDestinationsResult_ return } if mTypeId == thrift.EXCEPTION { - error35 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error36 error - error36, err = error35.Read(iprot) + error43 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error44 error + error44, err = error43.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error36 + err = error44 return } if mTypeId != thrift.REPLY { @@ -11531,16 +11797,16 @@ func (p *BFrontendClient) recvCreateConsumerGroup() (value *ConsumerGroupDescrip return } if mTypeId == thrift.EXCEPTION { - error37 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error38 error - error38, err = error37.Read(iprot) + error45 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error46 error + error46, err = error45.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error38 + err = error46 return } if mTypeId != thrift.REPLY { @@ -11614,16 +11880,16 @@ func (p *BFrontendClient) recvReadConsumerGroup() (value *ConsumerGroupDescripti return } if mTypeId == thrift.EXCEPTION { - error39 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error40 error - error40, err = error39.Read(iprot) + error47 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error48 error + error48, err = error47.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error40 + err = error48 return } if mTypeId != thrift.REPLY { @@ -11697,16 +11963,16 @@ func (p *BFrontendClient) recvUpdateConsumerGroup() (value *ConsumerGroupDescrip return } if mTypeId == thrift.EXCEPTION { - error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error42 error - error42, err = error41.Read(iprot) + error49 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error50 error + error50, err = error49.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error42 + err = error50 return } if mTypeId != thrift.REPLY { @@ -11780,16 +12046,16 @@ func (p *BFrontendClient) recvDeleteConsumerGroup() (err error) { return } if mTypeId == thrift.EXCEPTION { - error43 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error44 error - error44, err = error43.Read(iprot) + error51 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error52 error + error52, err = error51.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error44 + err = error52 return } if mTypeId != thrift.REPLY { @@ -11862,16 +12128,16 @@ func (p *BFrontendClient) recvListConsumerGroups() (value *ListConsumerGroupResu return } if mTypeId == thrift.EXCEPTION { - error45 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error46 error - error46, err = error45.Read(iprot) + error53 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error54 error + error54, err = error53.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error46 + err = error54 return } if mTypeId != thrift.REPLY { @@ -11945,16 +12211,16 @@ func (p *BFrontendClient) recvReadDestinationHosts() (value *ReadDestinationHost return } if mTypeId == thrift.EXCEPTION { - error47 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error48 error - error48, err = error47.Read(iprot) + error55 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error56 error + error56, err = error55.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error48 + err = error56 return } if mTypeId != thrift.REPLY { @@ -12031,16 +12297,16 @@ func (p *BFrontendClient) recvReadPublisherOptions() (value *ReadPublisherOption return } if mTypeId == thrift.EXCEPTION { - error49 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error50 error - error50, err = error49.Read(iprot) + error57 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error58 error + error58, err = error57.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error50 + err = error58 return } if mTypeId != thrift.REPLY { @@ -12117,16 +12383,16 @@ func (p *BFrontendClient) recvReadConsumerGroupHosts() (value *ReadConsumerGroup return } if mTypeId == thrift.EXCEPTION { - error51 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error52 error - error52, err = error51.Read(iprot) + error59 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error60 error + error60, err = error59.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error52 + err = error60 return } if mTypeId != thrift.REPLY { @@ -12205,16 +12471,16 @@ func (p *BFrontendClient) recvPurgeDLQForConsumerGroup() (err error) { return } if mTypeId == thrift.EXCEPTION { - error53 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error54 error - error54, err = error53.Read(iprot) + error61 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error62 error + error62, err = error61.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error54 + err = error62 return } if mTypeId != thrift.REPLY { @@ -12287,16 +12553,16 @@ func (p *BFrontendClient) recvMergeDLQForConsumerGroup() (err error) { return } if mTypeId == thrift.EXCEPTION { - error55 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error56 error - error56, err = error55.Read(iprot) + error63 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error64 error + error64, err = error63.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error56 + err = error64 return } if mTypeId != thrift.REPLY { @@ -12371,16 +12637,16 @@ func (p *BFrontendClient) recvGetQueueDepthInfo() (value *GetQueueDepthInfoResul return } if mTypeId == thrift.EXCEPTION { - error57 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error58 error - error58, err = error57.Read(iprot) + error65 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error66 error + error66, err = error65.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error58 + err = error66 return } if mTypeId != thrift.REPLY { @@ -12426,25 +12692,25 @@ func (p *BFrontendProcessor) ProcessorMap() map[string]thrift.TProcessorFunction func NewBFrontendProcessor(handler BFrontend) *BFrontendProcessor { - self59 := &BFrontendProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self59.processorMap["HostPort"] = &bFrontendProcessorHostPort{handler:handler} - self59.processorMap["createDestination"] = &bFrontendProcessorCreateDestination{handler:handler} - self59.processorMap["readDestination"] = &bFrontendProcessorReadDestination{handler:handler} - self59.processorMap["updateDestination"] = &bFrontendProcessorUpdateDestination{handler:handler} - self59.processorMap["deleteDestination"] = &bFrontendProcessorDeleteDestination{handler:handler} - self59.processorMap["listDestinations"] = &bFrontendProcessorListDestinations{handler:handler} - self59.processorMap["createConsumerGroup"] = &bFrontendProcessorCreateConsumerGroup{handler:handler} - self59.processorMap["readConsumerGroup"] = &bFrontendProcessorReadConsumerGroup{handler:handler} - self59.processorMap["updateConsumerGroup"] = &bFrontendProcessorUpdateConsumerGroup{handler:handler} - self59.processorMap["deleteConsumerGroup"] = &bFrontendProcessorDeleteConsumerGroup{handler:handler} - self59.processorMap["listConsumerGroups"] = &bFrontendProcessorListConsumerGroups{handler:handler} - self59.processorMap["readDestinationHosts"] = &bFrontendProcessorReadDestinationHosts{handler:handler} - self59.processorMap["readPublisherOptions"] = &bFrontendProcessorReadPublisherOptions{handler:handler} - self59.processorMap["readConsumerGroupHosts"] = &bFrontendProcessorReadConsumerGroupHosts{handler:handler} - self59.processorMap["purgeDLQForConsumerGroup"] = &bFrontendProcessorPurgeDLQForConsumerGroup{handler:handler} - self59.processorMap["mergeDLQForConsumerGroup"] = &bFrontendProcessorMergeDLQForConsumerGroup{handler:handler} - self59.processorMap["getQueueDepthInfo"] = &bFrontendProcessorGetQueueDepthInfo{handler:handler} -return self59 + self67 := &BFrontendProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self67.processorMap["HostPort"] = &bFrontendProcessorHostPort{handler:handler} + self67.processorMap["createDestination"] = &bFrontendProcessorCreateDestination{handler:handler} + self67.processorMap["readDestination"] = &bFrontendProcessorReadDestination{handler:handler} + self67.processorMap["updateDestination"] = &bFrontendProcessorUpdateDestination{handler:handler} + self67.processorMap["deleteDestination"] = &bFrontendProcessorDeleteDestination{handler:handler} + self67.processorMap["listDestinations"] = &bFrontendProcessorListDestinations{handler:handler} + self67.processorMap["createConsumerGroup"] = &bFrontendProcessorCreateConsumerGroup{handler:handler} + self67.processorMap["readConsumerGroup"] = &bFrontendProcessorReadConsumerGroup{handler:handler} + self67.processorMap["updateConsumerGroup"] = &bFrontendProcessorUpdateConsumerGroup{handler:handler} + self67.processorMap["deleteConsumerGroup"] = &bFrontendProcessorDeleteConsumerGroup{handler:handler} + self67.processorMap["listConsumerGroups"] = &bFrontendProcessorListConsumerGroups{handler:handler} + self67.processorMap["readDestinationHosts"] = &bFrontendProcessorReadDestinationHosts{handler:handler} + self67.processorMap["readPublisherOptions"] = &bFrontendProcessorReadPublisherOptions{handler:handler} + self67.processorMap["readConsumerGroupHosts"] = &bFrontendProcessorReadConsumerGroupHosts{handler:handler} + self67.processorMap["purgeDLQForConsumerGroup"] = &bFrontendProcessorPurgeDLQForConsumerGroup{handler:handler} + self67.processorMap["mergeDLQForConsumerGroup"] = &bFrontendProcessorMergeDLQForConsumerGroup{handler:handler} + self67.processorMap["getQueueDepthInfo"] = &bFrontendProcessorGetQueueDepthInfo{handler:handler} +return self67 } func (p *BFrontendProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -12455,12 +12721,12 @@ func (p *BFrontendProcessor) Process(iprot, oprot thrift.TProtocol) (success boo } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x60 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x68 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x60.Write(oprot) + x68.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x60 + return false, x68 } @@ -17733,16 +17999,16 @@ func (p *BInClient) recvPutMessageBatch() (value *PutMessageBatchResult_, err er return } if mTypeId == thrift.EXCEPTION { - error157 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error158 error - error158, err = error157.Read(iprot) + error165 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error166 error + error166, err = error165.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error158 + err = error166 return } if mTypeId != thrift.REPLY { @@ -17794,9 +18060,9 @@ func (p *BInProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { func NewBInProcessor(handler BIn) *BInProcessor { - self159 := &BInProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self159.processorMap["putMessageBatch"] = &bInProcessorPutMessageBatch{handler:handler} -return self159 + self167 := &BInProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self167.processorMap["putMessageBatch"] = &bInProcessorPutMessageBatch{handler:handler} +return self167 } func (p *BInProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -17807,12 +18073,12 @@ func (p *BInProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x160 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x168 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x160.Write(oprot) + x168.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x160 + return false, x168 } @@ -18311,16 +18577,16 @@ func (p *BOutClient) recvAckMessages() (err error) { return } if mTypeId == thrift.EXCEPTION { - error167 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error168 error - error168, err = error167.Read(iprot) + error175 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error176 error + error176, err = error175.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error168 + err = error176 return } if mTypeId != thrift.REPLY { @@ -18393,16 +18659,16 @@ func (p *BOutClient) recvSetConsumedMessages() (err error) { return } if mTypeId == thrift.EXCEPTION { - error169 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error170 error - error170, err = error169.Read(iprot) + error177 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error178 error + error178, err = error177.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error170 + err = error178 return } if mTypeId != thrift.REPLY { @@ -18478,16 +18744,16 @@ func (p *BOutClient) recvReceiveMessageBatch() (value *ReceiveMessageBatchResult return } if mTypeId == thrift.EXCEPTION { - error171 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error172 error - error172, err = error171.Read(iprot) + error179 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error180 error + error180, err = error179.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error172 + err = error180 return } if mTypeId != thrift.REPLY { @@ -18539,11 +18805,11 @@ func (p *BOutProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { func NewBOutProcessor(handler BOut) *BOutProcessor { - self173 := &BOutProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self173.processorMap["ackMessages"] = &bOutProcessorAckMessages{handler:handler} - self173.processorMap["setConsumedMessages"] = &bOutProcessorSetConsumedMessages{handler:handler} - self173.processorMap["receiveMessageBatch"] = &bOutProcessorReceiveMessageBatch{handler:handler} -return self173 + self181 := &BOutProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self181.processorMap["ackMessages"] = &bOutProcessorAckMessages{handler:handler} + self181.processorMap["setConsumedMessages"] = &bOutProcessorSetConsumedMessages{handler:handler} + self181.processorMap["receiveMessageBatch"] = &bOutProcessorReceiveMessageBatch{handler:handler} +return self181 } func (p *BOutProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -18554,12 +18820,12 @@ func (p *BOutProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, er } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x174 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x182 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x174.Write(oprot) + x182.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x174 + return false, x182 } diff --git a/.generated/go/cherami/tchan-cherami.go b/.generated/go/cherami/tchan-cherami.go index 61f1415..0543dbd 100644 --- a/.generated/go/cherami/tchan-cherami.go +++ b/.generated/go/cherami/tchan-cherami.go @@ -89,6 +89,10 @@ func (c *tchanBFrontendClient) HostPort(ctx thrift.Context) (string, error) { args := BFrontendHostPortArgs{} success, err := c.client.Call(ctx, c.thriftService, "HostPort", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for HostPort") + } } return resp.GetSuccess(), err @@ -101,11 +105,13 @@ func (c *tchanBFrontendClient) CreateConsumerGroup(ctx thrift.Context, registerR } success, err := c.client.Call(ctx, c.thriftService, "createConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for createConsumerGroup") } } @@ -119,11 +125,13 @@ func (c *tchanBFrontendClient) CreateDestination(ctx thrift.Context, createReque } success, err := c.client.Call(ctx, c.thriftService, "createDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for createDestination") } } @@ -137,11 +145,13 @@ func (c *tchanBFrontendClient) DeleteConsumerGroup(ctx thrift.Context, deleteReq } success, err := c.client.Call(ctx, c.thriftService, "deleteConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for deleteConsumerGroup") } } @@ -155,11 +165,13 @@ func (c *tchanBFrontendClient) DeleteDestination(ctx thrift.Context, deleteReque } success, err := c.client.Call(ctx, c.thriftService, "deleteDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for deleteDestination") } } @@ -173,11 +185,13 @@ func (c *tchanBFrontendClient) GetQueueDepthInfo(ctx thrift.Context, getQueueDep } success, err := c.client.Call(ctx, c.thriftService, "getQueueDepthInfo", &args, &resp) if err == nil && !success { - if e := resp.CacheMissError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.CacheMissError != nil: + err = resp.CacheMissError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for getQueueDepthInfo") } } @@ -191,8 +205,11 @@ func (c *tchanBFrontendClient) ListConsumerGroups(ctx thrift.Context, listReques } success, err := c.client.Call(ctx, c.thriftService, "listConsumerGroups", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for listConsumerGroups") } } @@ -206,8 +223,11 @@ func (c *tchanBFrontendClient) ListDestinations(ctx thrift.Context, listRequest } success, err := c.client.Call(ctx, c.thriftService, "listDestinations", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for listDestinations") } } @@ -221,11 +241,13 @@ func (c *tchanBFrontendClient) MergeDLQForConsumerGroup(ctx thrift.Context, merg } success, err := c.client.Call(ctx, c.thriftService, "mergeDLQForConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for mergeDLQForConsumerGroup") } } @@ -239,11 +261,13 @@ func (c *tchanBFrontendClient) PurgeDLQForConsumerGroup(ctx thrift.Context, purg } success, err := c.client.Call(ctx, c.thriftService, "purgeDLQForConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for purgeDLQForConsumerGroup") } } @@ -257,11 +281,13 @@ func (c *tchanBFrontendClient) ReadConsumerGroup(ctx thrift.Context, getRequest } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroup") } } @@ -275,14 +301,15 @@ func (c *tchanBFrontendClient) ReadConsumerGroupHosts(ctx thrift.Context, getHos } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupHosts", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.EntityDisabled; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.EntityDisabled != nil: + err = resp.EntityDisabled + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupHosts") } } @@ -296,11 +323,13 @@ func (c *tchanBFrontendClient) ReadDestination(ctx thrift.Context, getRequest *R } success, err := c.client.Call(ctx, c.thriftService, "readDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for readDestination") } } @@ -314,14 +343,15 @@ func (c *tchanBFrontendClient) ReadDestinationHosts(ctx thrift.Context, getHosts } success, err := c.client.Call(ctx, c.thriftService, "readDestinationHosts", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.EntityDisabled; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.EntityDisabled != nil: + err = resp.EntityDisabled + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for readDestinationHosts") } } @@ -335,14 +365,15 @@ func (c *tchanBFrontendClient) ReadPublisherOptions(ctx thrift.Context, getPubli } success, err := c.client.Call(ctx, c.thriftService, "readPublisherOptions", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.EntityDisabled; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.EntityDisabled != nil: + err = resp.EntityDisabled + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for readPublisherOptions") } } @@ -356,11 +387,13 @@ func (c *tchanBFrontendClient) UpdateConsumerGroup(ctx thrift.Context, updateReq } success, err := c.client.Call(ctx, c.thriftService, "updateConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for updateConsumerGroup") } } @@ -374,11 +407,13 @@ func (c *tchanBFrontendClient) UpdateDestination(ctx thrift.Context, updateReque } success, err := c.client.Call(ctx, c.thriftService, "updateDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for updateDestination") } } @@ -1038,17 +1073,17 @@ func (c *tchanBInClient) PutMessageBatch(ctx thrift.Context, request *PutMessage } success, err := c.client.Call(ctx, c.thriftService, "putMessageBatch", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.EntityDisabled; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.EntityDisabled != nil: + err = resp.EntityDisabled + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for putMessageBatch") } } @@ -1154,11 +1189,13 @@ func (c *tchanBOutClient) AckMessages(ctx thrift.Context, ackRequest *AckMessage } success, err := c.client.Call(ctx, c.thriftService, "ackMessages", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for ackMessages") } } @@ -1172,17 +1209,17 @@ func (c *tchanBOutClient) ReceiveMessageBatch(ctx thrift.Context, request *Recei } success, err := c.client.Call(ctx, c.thriftService, "receiveMessageBatch", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.EntityDisabled; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.TimeoutError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.EntityDisabled != nil: + err = resp.EntityDisabled + case resp.RequestError != nil: + err = resp.RequestError + case resp.TimeoutError != nil: + err = resp.TimeoutError + default: + err = fmt.Errorf("received no result or unknown exception for receiveMessageBatch") } } @@ -1196,11 +1233,13 @@ func (c *tchanBOutClient) SetConsumedMessages(ctx thrift.Context, request *SetCo } success, err := c.client.Call(ctx, c.thriftService, "setConsumedMessages", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for setConsumedMessages") } } diff --git a/.generated/go/controller/tchan-controller.go b/.generated/go/controller/tchan-controller.go index 279df34..dfe73b6 100644 --- a/.generated/go/controller/tchan-controller.go +++ b/.generated/go/controller/tchan-controller.go @@ -88,14 +88,15 @@ func (c *tchanControllerClient) CreateConsumerGroup(ctx thrift.Context, createRe } success, err := c.client.Call(ctx, c.thriftService, "createConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for createConsumerGroup") } } @@ -109,14 +110,15 @@ func (c *tchanControllerClient) CreateDestination(ctx thrift.Context, createRequ } success, err := c.client.Call(ctx, c.thriftService, "createDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for createDestination") } } @@ -130,14 +132,15 @@ func (c *tchanControllerClient) CreateRemoteZoneConsumerGroupExtent(ctx thrift.C } success, err := c.client.Call(ctx, c.thriftService, "createRemoteZoneConsumerGroupExtent", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for createRemoteZoneConsumerGroupExtent") } } @@ -151,14 +154,15 @@ func (c *tchanControllerClient) CreateRemoteZoneExtent(ctx thrift.Context, creat } success, err := c.client.Call(ctx, c.thriftService, "createRemoteZoneExtent", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for createRemoteZoneExtent") } } @@ -172,14 +176,15 @@ func (c *tchanControllerClient) DeleteConsumerGroup(ctx thrift.Context, deleteRe } success, err := c.client.Call(ctx, c.thriftService, "deleteConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for deleteConsumerGroup") } } @@ -193,14 +198,15 @@ func (c *tchanControllerClient) DeleteDestination(ctx thrift.Context, deleteRequ } success, err := c.client.Call(ctx, c.thriftService, "deleteDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for deleteDestination") } } @@ -214,6 +220,10 @@ func (c *tchanControllerClient) GetCapacities(ctx thrift.Context, getCapacitiesR } success, err := c.client.Call(ctx, c.thriftService, "getCapacities", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for getCapacities") + } } return resp.GetSuccess(), err @@ -226,11 +236,13 @@ func (c *tchanControllerClient) GetInputHosts(ctx thrift.Context, getHostsReques } success, err := c.client.Call(ctx, c.thriftService, "getInputHosts", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for getInputHosts") } } @@ -244,11 +256,13 @@ func (c *tchanControllerClient) GetOutputHosts(ctx thrift.Context, getHostsReque } success, err := c.client.Call(ctx, c.thriftService, "getOutputHosts", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for getOutputHosts") } } @@ -262,8 +276,11 @@ func (c *tchanControllerClient) GetQueueDepthInfo(ctx thrift.Context, getQueueDe } success, err := c.client.Call(ctx, c.thriftService, "getQueueDepthInfo", &args, &resp) if err == nil && !success { - if e := resp.CacheMissError; e != nil { - err = e + switch { + case resp.CacheMissError != nil: + err = resp.CacheMissError + default: + err = fmt.Errorf("received no result or unknown exception for getQueueDepthInfo") } } @@ -277,6 +294,10 @@ func (c *tchanControllerClient) RemoveCapacities(ctx thrift.Context, removeCapac } success, err := c.client.Call(ctx, c.thriftService, "removeCapacities", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for removeCapacities") + } } return err @@ -289,6 +310,10 @@ func (c *tchanControllerClient) ReportConsumerGroupExtentMetric(ctx thrift.Conte } success, err := c.client.Call(ctx, c.thriftService, "reportConsumerGroupExtentMetric", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for reportConsumerGroupExtentMetric") + } } return err @@ -301,6 +326,10 @@ func (c *tchanControllerClient) ReportConsumerGroupMetric(ctx thrift.Context, re } success, err := c.client.Call(ctx, c.thriftService, "reportConsumerGroupMetric", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for reportConsumerGroupMetric") + } } return err @@ -313,6 +342,10 @@ func (c *tchanControllerClient) ReportDestinationExtentMetric(ctx thrift.Context } success, err := c.client.Call(ctx, c.thriftService, "reportDestinationExtentMetric", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for reportDestinationExtentMetric") + } } return err @@ -325,6 +358,10 @@ func (c *tchanControllerClient) ReportDestinationMetric(ctx thrift.Context, repo } success, err := c.client.Call(ctx, c.thriftService, "reportDestinationMetric", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for reportDestinationMetric") + } } return err @@ -337,6 +374,10 @@ func (c *tchanControllerClient) ReportNodeMetric(ctx thrift.Context, reportMetri } success, err := c.client.Call(ctx, c.thriftService, "reportNodeMetric", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for reportNodeMetric") + } } return err @@ -349,6 +390,10 @@ func (c *tchanControllerClient) ReportStoreExtentMetric(ctx thrift.Context, repo } success, err := c.client.Call(ctx, c.thriftService, "reportStoreExtentMetric", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for reportStoreExtentMetric") + } } return err @@ -361,14 +406,15 @@ func (c *tchanControllerClient) UpdateConsumerGroup(ctx thrift.Context, updateRe } success, err := c.client.Call(ctx, c.thriftService, "updateConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for updateConsumerGroup") } } @@ -382,14 +428,15 @@ func (c *tchanControllerClient) UpdateDestination(ctx thrift.Context, updateRequ } success, err := c.client.Call(ctx, c.thriftService, "updateDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for updateDestination") } } @@ -403,6 +450,10 @@ func (c *tchanControllerClient) UpsertInputHostCapacities(ctx thrift.Context, up } success, err := c.client.Call(ctx, c.thriftService, "upsertInputHostCapacities", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for upsertInputHostCapacities") + } } return err @@ -415,6 +466,10 @@ func (c *tchanControllerClient) UpsertOutputHostCapacities(ctx thrift.Context, u } success, err := c.client.Call(ctx, c.thriftService, "upsertOutputHostCapacities", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for upsertOutputHostCapacities") + } } return err @@ -427,6 +482,10 @@ func (c *tchanControllerClient) UpsertStoreCapacities(ctx thrift.Context, upsert } success, err := c.client.Call(ctx, c.thriftService, "upsertStoreCapacities", &args, &resp) if err == nil && !success { + switch { + default: + err = fmt.Errorf("received no result or unknown exception for upsertStoreCapacities") + } } return err diff --git a/.generated/go/metadata/tchan-metadata.go b/.generated/go/metadata/tchan-metadata.go index f5bf499..853f051 100644 --- a/.generated/go/metadata/tchan-metadata.go +++ b/.generated/go/metadata/tchan-metadata.go @@ -122,11 +122,13 @@ func (c *tchanMetadataExposableClient) ListEntityOps(ctx thrift.Context, listReq } success, err := c.client.Call(ctx, c.thriftService, "ListEntityOps", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for ListEntityOps") } } @@ -140,8 +142,11 @@ func (c *tchanMetadataExposableClient) CreateServiceConfig(ctx thrift.Context, r } success, err := c.client.Call(ctx, c.thriftService, "createServiceConfig", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for createServiceConfig") } } @@ -155,8 +160,11 @@ func (c *tchanMetadataExposableClient) DeleteServiceConfig(ctx thrift.Context, r } success, err := c.client.Call(ctx, c.thriftService, "deleteServiceConfig", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for deleteServiceConfig") } } @@ -170,11 +178,13 @@ func (c *tchanMetadataExposableClient) HostAddrToUUID(ctx thrift.Context, hostAd } success, err := c.client.Call(ctx, c.thriftService, "hostAddrToUUID", &args, &resp) if err == nil && !success { - if e := resp.NotExistsError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.NotExistsError != nil: + err = resp.NotExistsError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for hostAddrToUUID") } } @@ -188,11 +198,13 @@ func (c *tchanMetadataExposableClient) ListAllConsumerGroups(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "listAllConsumerGroups", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for listAllConsumerGroups") } } @@ -206,11 +218,13 @@ func (c *tchanMetadataExposableClient) ListConsumerGroups(ctx thrift.Context, li } success, err := c.client.Call(ctx, c.thriftService, "listConsumerGroups", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for listConsumerGroups") } } @@ -224,11 +238,13 @@ func (c *tchanMetadataExposableClient) ListDestinations(ctx thrift.Context, list } success, err := c.client.Call(ctx, c.thriftService, "listDestinations", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listDestinations") } } @@ -242,11 +258,13 @@ func (c *tchanMetadataExposableClient) ListDestinationsByUUID(ctx thrift.Context } success, err := c.client.Call(ctx, c.thriftService, "listDestinationsByUUID", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listDestinationsByUUID") } } @@ -260,11 +278,13 @@ func (c *tchanMetadataExposableClient) ListExtentsStats(ctx thrift.Context, requ } success, err := c.client.Call(ctx, c.thriftService, "listExtentsStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listExtentsStats") } } @@ -278,11 +298,13 @@ func (c *tchanMetadataExposableClient) ListHosts(ctx thrift.Context, request *Li } success, err := c.client.Call(ctx, c.thriftService, "listHosts", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for listHosts") } } @@ -296,11 +318,13 @@ func (c *tchanMetadataExposableClient) ListInputHostExtentsStats(ctx thrift.Cont } success, err := c.client.Call(ctx, c.thriftService, "listInputHostExtentsStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for listInputHostExtentsStats") } } @@ -314,11 +338,13 @@ func (c *tchanMetadataExposableClient) ListStoreExtentsStats(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "listStoreExtentsStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for listStoreExtentsStats") } } @@ -332,14 +358,15 @@ func (c *tchanMetadataExposableClient) ReadConsumerGroup(ctx thrift.Context, get } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroup") } } @@ -353,14 +380,15 @@ func (c *tchanMetadataExposableClient) ReadConsumerGroupByUUID(ctx thrift.Contex } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupByUUID", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.EntityError != nil: + err = resp.EntityError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupByUUID") } } @@ -374,11 +402,13 @@ func (c *tchanMetadataExposableClient) ReadConsumerGroupExtent(ctx thrift.Contex } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupExtent", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupExtent") } } @@ -392,11 +422,13 @@ func (c *tchanMetadataExposableClient) ReadConsumerGroupExtents(ctx thrift.Conte } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupExtents", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupExtents") } } @@ -410,11 +442,13 @@ func (c *tchanMetadataExposableClient) ReadConsumerGroupExtentsByExtUUID(ctx thr } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupExtentsByExtUUID", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupExtentsByExtUUID") } } @@ -428,14 +462,15 @@ func (c *tchanMetadataExposableClient) ReadDestination(ctx thrift.Context, getRe } success, err := c.client.Call(ctx, c.thriftService, "readDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readDestination") } } @@ -449,11 +484,13 @@ func (c *tchanMetadataExposableClient) ReadExtentStats(ctx thrift.Context, reque } success, err := c.client.Call(ctx, c.thriftService, "readExtentStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for readExtentStats") } } @@ -467,8 +504,11 @@ func (c *tchanMetadataExposableClient) ReadServiceConfig(ctx thrift.Context, req } success, err := c.client.Call(ctx, c.thriftService, "readServiceConfig", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for readServiceConfig") } } @@ -482,11 +522,13 @@ func (c *tchanMetadataExposableClient) UUIDToHostAddr(ctx thrift.Context, hostUU } success, err := c.client.Call(ctx, c.thriftService, "uUIDToHostAddr", &args, &resp) if err == nil && !success { - if e := resp.NotExistsError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.NotExistsError != nil: + err = resp.NotExistsError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for uUIDToHostAddr") } } @@ -500,8 +542,11 @@ func (c *tchanMetadataExposableClient) UpdateServiceConfig(ctx thrift.Context, r } success, err := c.client.Call(ctx, c.thriftService, "updateServiceConfig", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for updateServiceConfig") } } @@ -1348,17 +1393,17 @@ func (c *tchanMetadataServiceClient) CreateConsumerGroupUUID(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "CreateConsumerGroupUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.EntityNotExistsError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.EntityNotExistsError != nil: + err = resp.EntityNotExistsError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for CreateConsumerGroupUUID") } } @@ -1372,17 +1417,17 @@ func (c *tchanMetadataServiceClient) CreateConsumerGroup(ctx thrift.Context, cre } success, err := c.client.Call(ctx, c.thriftService, "createConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.EntityNotExistsError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.EntityNotExistsError != nil: + err = resp.EntityNotExistsError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createConsumerGroup") } } @@ -1396,8 +1441,11 @@ func (c *tchanMetadataServiceClient) CreateConsumerGroupExtent(ctx thrift.Contex } success, err := c.client.Call(ctx, c.thriftService, "createConsumerGroupExtent", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createConsumerGroupExtent") } } @@ -1411,14 +1459,15 @@ func (c *tchanMetadataServiceClient) CreateDestination(ctx thrift.Context, creat } success, err := c.client.Call(ctx, c.thriftService, "createDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createDestination") } } @@ -1432,14 +1481,15 @@ func (c *tchanMetadataServiceClient) CreateDestinationUUID(ctx thrift.Context, c } success, err := c.client.Call(ctx, c.thriftService, "createDestinationUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createDestinationUUID") } } @@ -1453,14 +1503,15 @@ func (c *tchanMetadataServiceClient) CreateExtent(ctx thrift.Context, request *s } success, err := c.client.Call(ctx, c.thriftService, "createExtent", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createExtent") } } @@ -1474,8 +1525,11 @@ func (c *tchanMetadataServiceClient) CreateHostInfo(ctx thrift.Context, request } success, err := c.client.Call(ctx, c.thriftService, "createHostInfo", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for createHostInfo") } } @@ -1489,14 +1543,15 @@ func (c *tchanMetadataServiceClient) DeleteConsumerGroup(ctx thrift.Context, del } success, err := c.client.Call(ctx, c.thriftService, "deleteConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteConsumerGroup") } } @@ -1510,14 +1565,15 @@ func (c *tchanMetadataServiceClient) DeleteDestination(ctx thrift.Context, delet } success, err := c.client.Call(ctx, c.thriftService, "deleteDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteDestination") } } @@ -1531,14 +1587,15 @@ func (c *tchanMetadataServiceClient) DeleteDestinationUUID(ctx thrift.Context, d } success, err := c.client.Call(ctx, c.thriftService, "deleteDestinationUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteDestinationUUID") } } @@ -1552,8 +1609,11 @@ func (c *tchanMetadataServiceClient) DeleteHostInfo(ctx thrift.Context, request } success, err := c.client.Call(ctx, c.thriftService, "deleteHostInfo", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for deleteHostInfo") } } @@ -1567,11 +1627,13 @@ func (c *tchanMetadataServiceClient) ListDestinationExtents(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "listDestinationExtents", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listDestinationExtents") } } @@ -1585,14 +1647,15 @@ func (c *tchanMetadataServiceClient) MoveExtent(ctx thrift.Context, request *Mov } success, err := c.client.Call(ctx, c.thriftService, "moveExtent", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.IllegalStateError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.IllegalStateError != nil: + err = resp.IllegalStateError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for moveExtent") } } @@ -1606,11 +1669,13 @@ func (c *tchanMetadataServiceClient) ReadConsumerGroupExtentsLite(ctx thrift.Con } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupExtentsLite", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupExtentsLite") } } @@ -1624,8 +1689,11 @@ func (c *tchanMetadataServiceClient) ReadHostInfo(ctx thrift.Context, request *R } success, err := c.client.Call(ctx, c.thriftService, "readHostInfo", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for readHostInfo") } } @@ -1639,11 +1707,13 @@ func (c *tchanMetadataServiceClient) ReadStoreExtentReplicaStats(ctx thrift.Cont } success, err := c.client.Call(ctx, c.thriftService, "readStoreExtentReplicaStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readStoreExtentReplicaStats") } } @@ -1657,8 +1727,11 @@ func (c *tchanMetadataServiceClient) RegisterHostUUID(ctx thrift.Context, reques } success, err := c.client.Call(ctx, c.thriftService, "registerHostUUID", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for registerHostUUID") } } @@ -1672,14 +1745,15 @@ func (c *tchanMetadataServiceClient) SealExtent(ctx thrift.Context, request *Sea } success, err := c.client.Call(ctx, c.thriftService, "sealExtent", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.IllegalStateError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.IllegalStateError != nil: + err = resp.IllegalStateError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for sealExtent") } } @@ -1693,8 +1767,11 @@ func (c *tchanMetadataServiceClient) SetAckOffset(ctx thrift.Context, request *s } success, err := c.client.Call(ctx, c.thriftService, "setAckOffset", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for setAckOffset") } } @@ -1708,8 +1785,11 @@ func (c *tchanMetadataServiceClient) SetOutputHost(ctx thrift.Context, request * } success, err := c.client.Call(ctx, c.thriftService, "setOutputHost", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for setOutputHost") } } @@ -1723,14 +1803,15 @@ func (c *tchanMetadataServiceClient) UpdateConsumerGroup(ctx thrift.Context, upd } success, err := c.client.Call(ctx, c.thriftService, "updateConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateConsumerGroup") } } @@ -1744,14 +1825,15 @@ func (c *tchanMetadataServiceClient) UpdateConsumerGroupExtentStatus(ctx thrift. } success, err := c.client.Call(ctx, c.thriftService, "updateConsumerGroupExtentStatus", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e - } - if e := resp.NotExistsError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + case resp.NotExistsError != nil: + err = resp.NotExistsError + default: + err = fmt.Errorf("received no result or unknown exception for updateConsumerGroupExtentStatus") } } @@ -1765,14 +1847,15 @@ func (c *tchanMetadataServiceClient) UpdateDestination(ctx thrift.Context, updat } success, err := c.client.Call(ctx, c.thriftService, "updateDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateDestination") } } @@ -1786,14 +1869,15 @@ func (c *tchanMetadataServiceClient) UpdateDestinationDLQCursors(ctx thrift.Cont } success, err := c.client.Call(ctx, c.thriftService, "updateDestinationDLQCursors", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateDestinationDLQCursors") } } @@ -1807,11 +1891,13 @@ func (c *tchanMetadataServiceClient) UpdateExtentReplicaStats(ctx thrift.Context } success, err := c.client.Call(ctx, c.thriftService, "updateExtentReplicaStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateExtentReplicaStats") } } @@ -1825,14 +1911,15 @@ func (c *tchanMetadataServiceClient) UpdateExtentStats(ctx thrift.Context, reque } success, err := c.client.Call(ctx, c.thriftService, "updateExtentStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.EntityNotExistsError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.EntityNotExistsError != nil: + err = resp.EntityNotExistsError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateExtentStats") } } @@ -1846,8 +1933,11 @@ func (c *tchanMetadataServiceClient) UpdateHostInfo(ctx thrift.Context, request } success, err := c.client.Call(ctx, c.thriftService, "updateHostInfo", &args, &resp) if err == nil && !success { - if e := resp.Error; e != nil { - err = e + switch { + case resp.Error != nil: + err = resp.Error + default: + err = fmt.Errorf("received no result or unknown exception for updateHostInfo") } } @@ -1861,11 +1951,13 @@ func (c *tchanMetadataServiceClient) UpdateStoreExtentReplicaStats(ctx thrift.Co } success, err := c.client.Call(ctx, c.thriftService, "updateStoreExtentReplicaStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateStoreExtentReplicaStats") } } diff --git a/.generated/go/replicator/tchan-replicator.go b/.generated/go/replicator/tchan-replicator.go index 368d196..3dfdd0b 100644 --- a/.generated/go/replicator/tchan-replicator.go +++ b/.generated/go/replicator/tchan-replicator.go @@ -93,8 +93,11 @@ func (c *tchanReplicatorClient) CreateConsumerGroupExtent(ctx thrift.Context, re } success, err := c.client.Call(ctx, c.thriftService, "createConsumerGroupExtent", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createConsumerGroupExtent") } } @@ -108,14 +111,15 @@ func (c *tchanReplicatorClient) CreateConsumerGroupUUID(ctx thrift.Context, crea } success, err := c.client.Call(ctx, c.thriftService, "createConsumerGroupUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createConsumerGroupUUID") } } @@ -129,14 +133,15 @@ func (c *tchanReplicatorClient) CreateDestinationUUID(ctx thrift.Context, create } success, err := c.client.Call(ctx, c.thriftService, "createDestinationUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createDestinationUUID") } } @@ -150,14 +155,15 @@ func (c *tchanReplicatorClient) CreateExtent(ctx thrift.Context, createRequest * } success, err := c.client.Call(ctx, c.thriftService, "createExtent", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createExtent") } } @@ -171,8 +177,11 @@ func (c *tchanReplicatorClient) CreateRemoteConsumerGroupExtent(ctx thrift.Conte } success, err := c.client.Call(ctx, c.thriftService, "createRemoteConsumerGroupExtent", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createRemoteConsumerGroupExtent") } } @@ -186,14 +195,15 @@ func (c *tchanReplicatorClient) CreateRemoteConsumerGroupUUID(ctx thrift.Context } success, err := c.client.Call(ctx, c.thriftService, "createRemoteConsumerGroupUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createRemoteConsumerGroupUUID") } } @@ -207,14 +217,15 @@ func (c *tchanReplicatorClient) CreateRemoteDestinationUUID(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "createRemoteDestinationUUID", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createRemoteDestinationUUID") } } @@ -228,14 +239,15 @@ func (c *tchanReplicatorClient) CreateRemoteExtent(ctx thrift.Context, createReq } success, err := c.client.Call(ctx, c.thriftService, "createRemoteExtent", &args, &resp) if err == nil && !success { - if e := resp.EntityExistsError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityExistsError != nil: + err = resp.EntityExistsError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for createRemoteExtent") } } @@ -249,14 +261,15 @@ func (c *tchanReplicatorClient) DeleteConsumerGroup(ctx thrift.Context, deleteRe } success, err := c.client.Call(ctx, c.thriftService, "deleteConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteConsumerGroup") } } @@ -270,14 +283,15 @@ func (c *tchanReplicatorClient) DeleteDestination(ctx thrift.Context, deleteRequ } success, err := c.client.Call(ctx, c.thriftService, "deleteDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteDestination") } } @@ -291,14 +305,15 @@ func (c *tchanReplicatorClient) DeleteRemoteConsumerGroup(ctx thrift.Context, de } success, err := c.client.Call(ctx, c.thriftService, "deleteRemoteConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteRemoteConsumerGroup") } } @@ -312,14 +327,15 @@ func (c *tchanReplicatorClient) DeleteRemoteDestination(ctx thrift.Context, dele } success, err := c.client.Call(ctx, c.thriftService, "deleteRemoteDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for deleteRemoteDestination") } } @@ -333,11 +349,13 @@ func (c *tchanReplicatorClient) ListConsumerGroups(ctx thrift.Context, listReque } success, err := c.client.Call(ctx, c.thriftService, "listConsumerGroups", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for listConsumerGroups") } } @@ -351,11 +369,13 @@ func (c *tchanReplicatorClient) ListDestinations(ctx thrift.Context, listRequest } success, err := c.client.Call(ctx, c.thriftService, "listDestinations", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listDestinations") } } @@ -369,11 +389,13 @@ func (c *tchanReplicatorClient) ListDestinationsByUUID(ctx thrift.Context, listR } success, err := c.client.Call(ctx, c.thriftService, "listDestinationsByUUID", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listDestinationsByUUID") } } @@ -387,11 +409,13 @@ func (c *tchanReplicatorClient) ListExtentsStats(ctx thrift.Context, request *sh } success, err := c.client.Call(ctx, c.thriftService, "listExtentsStats", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listExtentsStats") } } @@ -405,14 +429,15 @@ func (c *tchanReplicatorClient) ReadConsumerGroup(ctx thrift.Context, getRequest } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroup") } } @@ -426,11 +451,13 @@ func (c *tchanReplicatorClient) ReadConsumerGroupExtents(ctx thrift.Context, req } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupExtents", &args, &resp) if err == nil && !success { - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalError; e != nil { - err = e + switch { + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalError != nil: + err = resp.InternalError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupExtents") } } @@ -444,14 +471,15 @@ func (c *tchanReplicatorClient) ReadConsumerGroupInRemoteZone(ctx thrift.Context } success, err := c.client.Call(ctx, c.thriftService, "readConsumerGroupInRemoteZone", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readConsumerGroupInRemoteZone") } } @@ -465,14 +493,15 @@ func (c *tchanReplicatorClient) ReadDestination(ctx thrift.Context, getRequest * } success, err := c.client.Call(ctx, c.thriftService, "readDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readDestination") } } @@ -486,14 +515,15 @@ func (c *tchanReplicatorClient) ReadDestinationInRemoteZone(ctx thrift.Context, } success, err := c.client.Call(ctx, c.thriftService, "readDestinationInRemoteZone", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readDestinationInRemoteZone") } } @@ -507,8 +537,11 @@ func (c *tchanReplicatorClient) SetAckOffset(ctx thrift.Context, request *shared } success, err := c.client.Call(ctx, c.thriftService, "setAckOffset", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for setAckOffset") } } @@ -522,8 +555,11 @@ func (c *tchanReplicatorClient) SetAckOffsetInRemote(ctx thrift.Context, request } success, err := c.client.Call(ctx, c.thriftService, "setAckOffsetInRemote", &args, &resp) if err == nil && !success { - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for setAckOffsetInRemote") } } @@ -537,14 +573,15 @@ func (c *tchanReplicatorClient) UpdateConsumerGroup(ctx thrift.Context, updateRe } success, err := c.client.Call(ctx, c.thriftService, "updateConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateConsumerGroup") } } @@ -558,14 +595,15 @@ func (c *tchanReplicatorClient) UpdateDestination(ctx thrift.Context, updateRequ } success, err := c.client.Call(ctx, c.thriftService, "updateDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateDestination") } } @@ -579,14 +617,15 @@ func (c *tchanReplicatorClient) UpdateRemoteConsumerGroup(ctx thrift.Context, up } success, err := c.client.Call(ctx, c.thriftService, "updateRemoteConsumerGroup", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateRemoteConsumerGroup") } } @@ -600,14 +639,15 @@ func (c *tchanReplicatorClient) UpdateRemoteDestination(ctx thrift.Context, upda } success, err := c.client.Call(ctx, c.thriftService, "updateRemoteDestination", &args, &resp) if err == nil && !success { - if e := resp.EntityError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.InternalServiceError; e != nil { - err = e + switch { + case resp.EntityError != nil: + err = resp.EntityError + case resp.RequestError != nil: + err = resp.RequestError + case resp.InternalServiceError != nil: + err = resp.InternalServiceError + default: + err = fmt.Errorf("received no result or unknown exception for updateRemoteDestination") } } diff --git a/.generated/go/shared/shared.go b/.generated/go/shared/shared.go index 573e38f..c795cb9 100644 --- a/.generated/go/shared/shared.go +++ b/.generated/go/shared/shared.go @@ -2278,6 +2278,7 @@ func (p *DestinationDescription) String() string { // - SchemaInfo // - KafkaCluster // - KafkaTopics +// - Options type CreateDestinationRequest struct { Path *string `thrift:"path,1" db:"path" json:"path,omitempty"` Type *DestinationType `thrift:"type,2" db:"type" json:"type,omitempty"` @@ -2295,6 +2296,7 @@ type CreateDestinationRequest struct { // unused fields # 21 to 39 KafkaCluster *string `thrift:"kafkaCluster,40" db:"kafkaCluster" json:"kafkaCluster,omitempty"` KafkaTopics []string `thrift:"kafkaTopics,41" db:"kafkaTopics" json:"kafkaTopics,omitempty"` + Options map[string]bool `thrift:"options,42" db:"options" json:"options,omitempty"` } func NewCreateDestinationRequest() *CreateDestinationRequest { @@ -2381,6 +2383,11 @@ var CreateDestinationRequest_KafkaTopics_DEFAULT []string func (p *CreateDestinationRequest) GetKafkaTopics() []string { return p.KafkaTopics } +var CreateDestinationRequest_Options_DEFAULT map[string]bool + +func (p *CreateDestinationRequest) GetOptions() map[string]bool { + return p.Options +} func (p *CreateDestinationRequest) IsSetPath() bool { return p.Path != nil } @@ -2429,6 +2436,10 @@ func (p *CreateDestinationRequest) IsSetKafkaTopics() bool { return p.KafkaTopics != nil } +func (p *CreateDestinationRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *CreateDestinationRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -2490,6 +2501,10 @@ func (p *CreateDestinationRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField41(iprot); err != nil { return err } + case 42: + if err := p.ReadField42(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2638,6 +2653,34 @@ var _elem3 string return nil } +func (p *CreateDestinationRequest) ReadField42(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key4 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key4 = v +} +var _val5 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val5 = v +} + p.Options[_key4] = _val5 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *CreateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("CreateDestinationRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -2654,6 +2697,7 @@ func (p *CreateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField20(oprot); err != nil { return err } if err := p.writeField40(oprot); err != nil { return err } if err := p.writeField41(oprot); err != nil { return err } + if err := p.writeField42(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -2824,6 +2868,28 @@ func (p *CreateDestinationRequest) writeField41(oprot thrift.TProtocol) (err err return err } +func (p *CreateDestinationRequest) writeField42(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 42); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 42:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 42:options: ", p), err) } + } + return err +} + func (p *CreateDestinationRequest) String() string { if p == nil { return "" @@ -3726,11 +3792,11 @@ func (p *ListDestinationsResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*DestinationDescription, 0, size) p.Destinations = tSlice for i := 0; i < size; i ++ { - _elem4 := &DestinationDescription{} - if err := _elem4.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + _elem6 := &DestinationDescription{} + if err := _elem6.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) } - p.Destinations = append(p.Destinations, _elem4) + p.Destinations = append(p.Destinations, _elem6) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4044,11 +4110,11 @@ func (p *UpdateDestinationRequest) ReadField11(iprot thrift.TProtocol) error { tSlice := make([]*DestinationZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem5 := &DestinationZoneConfig{} - if err := _elem5.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + _elem7 := &DestinationZoneConfig{} + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem5) + p.ZoneConfigs = append(p.ZoneConfigs, _elem7) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4840,6 +4906,7 @@ func (p *EntityOpsDescription) String() string { // - ActiveZone // - ZoneConfigs // - DelaySeconds +// - Options type ConsumerGroupDescription struct { ConsumerGroupUUID *string `thrift:"consumerGroupUUID,1" db:"consumerGroupUUID" json:"consumerGroupUUID,omitempty"` DestinationUUID *string `thrift:"destinationUUID,2" db:"destinationUUID" json:"destinationUUID,omitempty"` @@ -4859,6 +4926,7 @@ type ConsumerGroupDescription struct { ActiveZone *string `thrift:"activeZone,22" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs []*ConsumerGroupZoneConfig `thrift:"zoneConfigs,23" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,24" db:"delaySeconds" json:"delaySeconds,omitempty"` + Options map[string]bool `thrift:"options,25" db:"options" json:"options,omitempty"` } func NewConsumerGroupDescription() *ConsumerGroupDescription { @@ -4968,6 +5036,11 @@ func (p *ConsumerGroupDescription) GetDelaySeconds() int32 { } return *p.DelaySeconds } +var ConsumerGroupDescription_Options_DEFAULT map[string]bool + +func (p *ConsumerGroupDescription) GetOptions() map[string]bool { + return p.Options +} func (p *ConsumerGroupDescription) IsSetConsumerGroupUUID() bool { return p.ConsumerGroupUUID != nil } @@ -5028,6 +5101,10 @@ func (p *ConsumerGroupDescription) IsSetDelaySeconds() bool { return p.DelaySeconds != nil } +func (p *ConsumerGroupDescription) IsSetOptions() bool { + return p.Options != nil +} + func (p *ConsumerGroupDescription) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -5101,6 +5178,10 @@ func (p *ConsumerGroupDescription) Read(iprot thrift.TProtocol) error { if err := p.ReadField24(iprot); err != nil { return err } + case 25: + if err := p.ReadField25(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -5243,11 +5324,11 @@ func (p *ConsumerGroupDescription) ReadField23(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem6 := &ConsumerGroupZoneConfig{} - if err := _elem6.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + _elem8 := &ConsumerGroupZoneConfig{} + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem6) + p.ZoneConfigs = append(p.ZoneConfigs, _elem8) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5264,6 +5345,34 @@ func (p *ConsumerGroupDescription) ReadField24(iprot thrift.TProtocol) error { return nil } +func (p *ConsumerGroupDescription) ReadField25(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key9 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key9 = v +} +var _val10 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val10 = v +} + p.Options[_key9] = _val10 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *ConsumerGroupDescription) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("ConsumerGroupDescription"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -5283,6 +5392,7 @@ func (p *ConsumerGroupDescription) Write(oprot thrift.TProtocol) error { if err := p.writeField22(oprot); err != nil { return err } if err := p.writeField23(oprot); err != nil { return err } if err := p.writeField24(oprot); err != nil { return err } + if err := p.writeField25(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -5480,6 +5590,28 @@ func (p *ConsumerGroupDescription) writeField24(oprot thrift.TProtocol) (err err return err } +func (p *ConsumerGroupDescription) writeField25(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 25); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 25:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 25:options: ", p), err) } + } + return err +} + func (p *ConsumerGroupDescription) String() string { if p == nil { return "" @@ -5499,6 +5631,7 @@ func (p *ConsumerGroupDescription) String() string { // - ActiveZone // - ZoneConfigs // - DelaySeconds +// - Options type CreateConsumerGroupRequest struct { DestinationPath *string `thrift:"destinationPath,1" db:"destinationPath" json:"destinationPath,omitempty"` ConsumerGroupName *string `thrift:"consumerGroupName,2" db:"consumerGroupName" json:"consumerGroupName,omitempty"` @@ -5514,6 +5647,7 @@ type CreateConsumerGroupRequest struct { ActiveZone *string `thrift:"activeZone,12" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs []*ConsumerGroupZoneConfig `thrift:"zoneConfigs,13" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,14" db:"delaySeconds" json:"delaySeconds,omitempty"` + Options map[string]bool `thrift:"options,15" db:"options" json:"options,omitempty"` } func NewCreateConsumerGroupRequest() *CreateConsumerGroupRequest { @@ -5595,6 +5729,11 @@ func (p *CreateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } +var CreateConsumerGroupRequest_Options_DEFAULT map[string]bool + +func (p *CreateConsumerGroupRequest) GetOptions() map[string]bool { + return p.Options +} func (p *CreateConsumerGroupRequest) IsSetDestinationPath() bool { return p.DestinationPath != nil } @@ -5639,6 +5778,10 @@ func (p *CreateConsumerGroupRequest) IsSetDelaySeconds() bool { return p.DelaySeconds != nil } +func (p *CreateConsumerGroupRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *CreateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -5696,6 +5839,10 @@ func (p *CreateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField14(iprot); err != nil { return err } + case 15: + if err := p.ReadField15(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -5800,11 +5947,11 @@ func (p *CreateConsumerGroupRequest) ReadField13(iprot thrift.TProtocol) error tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem7 := &ConsumerGroupZoneConfig{} - if err := _elem7.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + _elem11 := &ConsumerGroupZoneConfig{} + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem7) + p.ZoneConfigs = append(p.ZoneConfigs, _elem11) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5821,6 +5968,34 @@ func (p *CreateConsumerGroupRequest) ReadField14(iprot thrift.TProtocol) error return nil } +func (p *CreateConsumerGroupRequest) ReadField15(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key12 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key12 = v +} +var _val13 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val13 = v +} + p.Options[_key12] = _val13 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *CreateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("CreateConsumerGroupRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -5836,6 +6011,7 @@ func (p *CreateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField12(oprot); err != nil { return err } if err := p.writeField13(oprot); err != nil { return err } if err := p.writeField14(oprot); err != nil { return err } + if err := p.writeField15(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -5985,6 +6161,28 @@ func (p *CreateConsumerGroupRequest) writeField14(oprot thrift.TProtocol) (err e return err } +func (p *CreateConsumerGroupRequest) writeField15(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 15); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 15:options: ", p), err) } + } + return err +} + func (p *CreateConsumerGroupRequest) String() string { if p == nil { return "" @@ -6139,6 +6337,7 @@ func (p *CreateConsumerGroupUUIDRequest) String() string { // - ActiveZone // - ZoneConfigs // - DelaySeconds +// - Options type UpdateConsumerGroupRequest struct { DestinationPath *string `thrift:"destinationPath,1" db:"destinationPath" json:"destinationPath,omitempty"` ConsumerGroupName *string `thrift:"consumerGroupName,2" db:"consumerGroupName" json:"consumerGroupName,omitempty"` @@ -6151,6 +6350,7 @@ type UpdateConsumerGroupRequest struct { ActiveZone *string `thrift:"activeZone,9" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs []*ConsumerGroupZoneConfig `thrift:"zoneConfigs,10" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,11" db:"delaySeconds" json:"delaySeconds,omitempty"` + Options map[string]bool `thrift:"options,12" db:"options" json:"options,omitempty"` } func NewUpdateConsumerGroupRequest() *UpdateConsumerGroupRequest { @@ -6232,6 +6432,11 @@ func (p *UpdateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } +var UpdateConsumerGroupRequest_Options_DEFAULT map[string]bool + +func (p *UpdateConsumerGroupRequest) GetOptions() map[string]bool { + return p.Options +} func (p *UpdateConsumerGroupRequest) IsSetDestinationPath() bool { return p.DestinationPath != nil } @@ -6276,6 +6481,10 @@ func (p *UpdateConsumerGroupRequest) IsSetDelaySeconds() bool { return p.DelaySeconds != nil } +func (p *UpdateConsumerGroupRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *UpdateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -6333,6 +6542,10 @@ func (p *UpdateConsumerGroupRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField11(iprot); err != nil { return err } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -6438,11 +6651,11 @@ func (p *UpdateConsumerGroupRequest) ReadField10(iprot thrift.TProtocol) error tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem8 := &ConsumerGroupZoneConfig{} - if err := _elem8.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + _elem14 := &ConsumerGroupZoneConfig{} + if err := _elem14.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem8) + p.ZoneConfigs = append(p.ZoneConfigs, _elem14) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -6459,6 +6672,34 @@ func (p *UpdateConsumerGroupRequest) ReadField11(iprot thrift.TProtocol) error return nil } +func (p *UpdateConsumerGroupRequest) ReadField12(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]bool, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key15 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key15 = v +} +var _val16 bool + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val16 = v +} + p.Options[_key15] = _val16 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *UpdateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("UpdateConsumerGroupRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -6474,6 +6715,7 @@ func (p *UpdateConsumerGroupRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField9(oprot); err != nil { return err } if err := p.writeField10(oprot); err != nil { return err } if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -6623,6 +6865,28 @@ func (p *UpdateConsumerGroupRequest) writeField11(oprot thrift.TProtocol) (err e return err } +func (p *UpdateConsumerGroupRequest) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBool(bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:options: ", p), err) } + } + return err +} + func (p *UpdateConsumerGroupRequest) String() string { if p == nil { return "" @@ -7468,11 +7732,11 @@ func (p *ListConsumerGroupResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupDescription, 0, size) p.ConsumerGroups = tSlice for i := 0; i < size; i ++ { - _elem9 := &ConsumerGroupDescription{} - if err := _elem9.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + _elem17 := &ConsumerGroupDescription{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) } - p.ConsumerGroups = append(p.ConsumerGroups, _elem9) + p.ConsumerGroups = append(p.ConsumerGroups, _elem17) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7705,13 +7969,13 @@ func (p *Extent) ReadField3(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.StoreUUIDs = tSlice for i := 0; i < size; i ++ { -var _elem10 string +var _elem18 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem10 = v + _elem18 = v } - p.StoreUUIDs = append(p.StoreUUIDs, _elem10) + p.StoreUUIDs = append(p.StoreUUIDs, _elem18) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8846,11 +9110,11 @@ func (p *ExtentStats) ReadField6(iprot thrift.TProtocol) error { tSlice := make([]*ExtentReplicaStats, 0, size) p.ReplicaStats = tSlice for i := 0; i < size; i ++ { - _elem11 := &ExtentReplicaStats{} - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + _elem19 := &ExtentReplicaStats{} + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) } - p.ReplicaStats = append(p.ReplicaStats, _elem11) + p.ReplicaStats = append(p.ReplicaStats, _elem19) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9305,13 +9569,13 @@ func (p *ConsumerGroupExtent) ReadField6(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.StoreUUIDs = tSlice for i := 0; i < size; i ++ { -var _elem12 string +var _elem20 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem12 = v + _elem20 = v } - p.StoreUUIDs = append(p.StoreUUIDs, _elem12) + p.StoreUUIDs = append(p.StoreUUIDs, _elem20) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10130,11 +10394,11 @@ func (p *ListExtentsStatsResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ExtentStats, 0, size) p.ExtentStatsList = tSlice for i := 0; i < size; i ++ { - _elem13 := &ExtentStats{} - if err := _elem13.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + _elem21 := &ExtentStats{} + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) } - p.ExtentStatsList = append(p.ExtentStatsList, _elem13) + p.ExtentStatsList = append(p.ExtentStatsList, _elem21) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10368,13 +10632,13 @@ func (p *CreateConsumerGroupExtentRequest) ReadField5(iprot thrift.TProtocol) e tSlice := make([]string, 0, size) p.StoreUUIDs = tSlice for i := 0; i < size; i ++ { -var _elem14 string +var _elem22 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem14 = v + _elem22 = v } - p.StoreUUIDs = append(p.StoreUUIDs, _elem14) + p.StoreUUIDs = append(p.StoreUUIDs, _elem22) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11495,11 +11759,11 @@ func (p *ReadConsumerGroupExtentsResult_) ReadField1(iprot thrift.TProtocol) er tSlice := make([]*ConsumerGroupExtent, 0, size) p.Extents = tSlice for i := 0; i < size; i ++ { - _elem15 := &ConsumerGroupExtent{} - if err := _elem15.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem15), err) + _elem23 := &ConsumerGroupExtent{} + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) } - p.Extents = append(p.Extents, _elem15) + p.Extents = append(p.Extents, _elem23) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) diff --git a/.generated/go/store/tchan-store.go b/.generated/go/store/tchan-store.go index e1cbc39..9008547 100644 --- a/.generated/go/store/tchan-store.go +++ b/.generated/go/store/tchan-store.go @@ -78,14 +78,15 @@ func (c *tchanBStoreClient) GetAddressFromTimestamp(ctx thrift.Context, getAddre } success, err := c.client.Call(ctx, c.thriftService, "getAddressFromTimestamp", &args, &resp) if err == nil && !success { - if e := resp.NotFoundError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.NotFoundError != nil: + err = resp.NotFoundError + case resp.RequestError != nil: + err = resp.RequestError + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for getAddressFromTimestamp") } } @@ -99,11 +100,13 @@ func (c *tchanBStoreClient) GetExtentInfo(ctx thrift.Context, extentInfoRequest } success, err := c.client.Call(ctx, c.thriftService, "getExtentInfo", &args, &resp) if err == nil && !success { - if e := resp.NotFoundError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e + switch { + case resp.NotFoundError != nil: + err = resp.NotFoundError + case resp.RequestError != nil: + err = resp.RequestError + default: + err = fmt.Errorf("received no result or unknown exception for getExtentInfo") } } @@ -115,8 +118,11 @@ func (c *tchanBStoreClient) ListExtents(ctx thrift.Context) (*ListExtentsResult_ args := BStoreListExtentsArgs{} success, err := c.client.Call(ctx, c.thriftService, "listExtents", &args, &resp) if err == nil && !success { - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for listExtents") } } @@ -130,14 +136,15 @@ func (c *tchanBStoreClient) PurgeMessages(ctx thrift.Context, purgeRequest *Purg } success, err := c.client.Call(ctx, c.thriftService, "purgeMessages", &args, &resp) if err == nil && !success { - if e := resp.NotFoundError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.NotFoundError != nil: + err = resp.NotFoundError + case resp.RequestError != nil: + err = resp.RequestError + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for purgeMessages") } } @@ -151,14 +158,15 @@ func (c *tchanBStoreClient) ReadMessages(ctx thrift.Context, readMessagesRequest } success, err := c.client.Call(ctx, c.thriftService, "readMessages", &args, &resp) if err == nil && !success { - if e := resp.ExtentNotFoundError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.ExtentNotFoundError != nil: + err = resp.ExtentNotFoundError + case resp.RequestError != nil: + err = resp.RequestError + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for readMessages") } } @@ -172,14 +180,15 @@ func (c *tchanBStoreClient) RemoteReplicateExtent(ctx thrift.Context, request *R } success, err := c.client.Call(ctx, c.thriftService, "remoteReplicateExtent", &args, &resp) if err == nil && !success { - if e := resp.ExtentNotFoundError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.ExtentNotFoundError != nil: + err = resp.ExtentNotFoundError + case resp.RequestError != nil: + err = resp.RequestError + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for remoteReplicateExtent") } } @@ -193,14 +202,15 @@ func (c *tchanBStoreClient) ReplicateExtent(ctx thrift.Context, replicateExtentR } success, err := c.client.Call(ctx, c.thriftService, "replicateExtent", &args, &resp) if err == nil && !success { - if e := resp.ExtentNotFoundError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.ExtentNotFoundError != nil: + err = resp.ExtentNotFoundError + case resp.RequestError != nil: + err = resp.RequestError + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for replicateExtent") } } @@ -214,17 +224,17 @@ func (c *tchanBStoreClient) SealExtent(ctx thrift.Context, sealRequest *SealExte } success, err := c.client.Call(ctx, c.thriftService, "sealExtent", &args, &resp) if err == nil && !success { - if e := resp.SealedError; e != nil { - err = e - } - if e := resp.FailedError; e != nil { - err = e - } - if e := resp.RequestError; e != nil { - err = e - } - if e := resp.ServiceError; e != nil { - err = e + switch { + case resp.SealedError != nil: + err = resp.SealedError + case resp.FailedError != nil: + err = resp.FailedError + case resp.RequestError != nil: + err = resp.RequestError + case resp.ServiceError != nil: + err = resp.ServiceError + default: + err = fmt.Errorf("received no result or unknown exception for sealExtent") } } diff --git a/idl/cherami/cherami.thrift b/idl/cherami/cherami.thrift index 0efdaf4..67319b5 100644 --- a/idl/cherami/cherami.thrift +++ b/idl/cherami/cherami.thrift @@ -136,6 +136,7 @@ enum ChecksumOption { * @param consumedMessagesRetention. Time in seconds to keep consumed messages before deleting from storage. * @param unconsumedMessagesRetention. Time in seconds to keep messages that may not have been consumed, before deleting from storage. * @param createdAt. Time when destination was created. + * @param options. Options user can choose for the destination, not used currently. **/ struct DestinationDescription { 1: optional string path @@ -151,6 +152,7 @@ struct DestinationDescription { 20: optional SchemaInfo schemaInfo // Latest schema for this destination 40: optional string kafkaCluster 41: optional list kafkaTopics + 42: optional map options // not used currently } struct SchemaInfo { @@ -186,6 +188,7 @@ struct CreateDestinationRequest { 20: optional SchemaInfo schemaInfo 40: optional string kafkaCluster 41: optional list kafkaTopics + 42: optional map options // not used currently } struct ReadDestinationRequest { @@ -199,8 +202,9 @@ struct UpdateDestinationRequest { 4: optional i32 unconsumedMessagesRetention 5: optional string ownerEmail 6: optional ChecksumOption checksumOption - 10: optional SchemaInfo schemaInfo - 11: optional DestinationZoneConfigs zoneConfigs + 10: optional SchemaInfo schemaInfo + 11: optional DestinationZoneConfigs zoneConfigs + 12: optional map options // not used currently } struct DeleteDestinationRequest { @@ -232,8 +236,9 @@ struct ListDestinationsResult { * @param skipOlderMessagesInSeconds. This is useful for consumers who always wants to keep up and don't care about * backlog older than certain duration. * @param createdAt. Time when ConsumerGroup was registered. -* @param delaySeconds. This specifies that the consumer-group would like every message to be delivered after the +* @param delaySeconds. This specifies that the consumer-group would like every message to be delivered after the * specified delay. +* @param options. Options user can choose for the consumer group, like disable_nack_throtting. **/ struct ConsumerGroupDescription { 1: optional string destinationPath @@ -251,6 +256,7 @@ struct ConsumerGroupDescription { 20: optional bool isMultiZone 21: optional ConsumerGroupZoneConfigs zoneConfigs 22: optional i32 delaySeconds + 23: optional map options } struct ConsumerGroupZoneConfig { @@ -277,6 +283,7 @@ struct CreateConsumerGroupRequest { 10: optional bool isMultiZone 11: optional ConsumerGroupZoneConfigs zoneConfigs 12: optional i32 delaySeconds + 13: optional map options } struct ReadConsumerGroupRequest { @@ -295,6 +302,7 @@ struct UpdateConsumerGroupRequest { 9: optional string activeZone 10: optional ConsumerGroupZoneConfigs zoneConfigs 11: optional i32 delaySeconds + 12: optional map options; } struct DeleteConsumerGroupRequest { diff --git a/idl/cherami_server/shared.thrift b/idl/cherami_server/shared.thrift index 6592221..d94545b 100644 --- a/idl/cherami_server/shared.thrift +++ b/idl/cherami_server/shared.thrift @@ -158,6 +158,7 @@ struct DestinationDescription { 30: optional SchemaInfo schemaInfo // Latest schema for this destination 40: optional string kafkaCluster 41: optional list kafkaTopics + 42: optional map options } struct CreateDestinationRequest { @@ -174,6 +175,7 @@ struct CreateDestinationRequest { 20: optional SchemaInfo schemaInfo 40: optional string kafkaCluster 41: optional list kafkaTopics + 42: optional map options } struct CreateDestinationUUIDRequest { @@ -223,6 +225,7 @@ struct UpdateDestinationRequest { 6: optional ChecksumOption checksumOption 10: optional SchemaInfo schemaInfo 11: optional list zoneConfigs + 13: optional map options } struct DeleteDestinationRequest { @@ -265,6 +268,7 @@ struct ConsumerGroupDescription { 22: optional string activeZone 23: optional list zoneConfigs 24: optional i32 delaySeconds + 25: optional map options } struct CreateConsumerGroupRequest { @@ -281,6 +285,7 @@ struct CreateConsumerGroupRequest { 12: optional string activeZone 13: optional list zoneConfigs 14: optional i32 delaySeconds + 15: optional map options } struct CreateConsumerGroupUUIDRequest { @@ -300,6 +305,7 @@ struct UpdateConsumerGroupRequest { 9: optional string activeZone 10: optional list zoneConfigs 11: optional i32 delaySeconds + 12: optional map options } struct DeleteConsumerGroupRequest { From ae27e7c773639eb26523c04357a45a4a88b4c0e1 Mon Sep 17 00:00:00 2001 From: Kobe Yang Date: Tue, 15 Aug 2017 16:16:49 -0700 Subject: [PATCH 2/2] Change options type to map --- .generated/go/cherami/cherami.go | 620 +++++++++++++++++++------------ .generated/go/shared/shared.go | 333 ++++++++++++----- idl/cherami/cherami.thrift | 12 +- idl/cherami_server/shared.thrift | 12 +- 4 files changed, 622 insertions(+), 355 deletions(-) diff --git a/.generated/go/cherami/cherami.go b/.generated/go/cherami/cherami.go index e2eae1c..ca78010 100644 --- a/.generated/go/cherami/cherami.go +++ b/.generated/go/cherami/cherami.go @@ -1303,6 +1303,7 @@ func (p *QueueCacheMissError) Error() string { // * @param consumedMessagesRetention. Time in seconds to keep consumed messages before deleting from storage. // * @param unconsumedMessagesRetention. Time in seconds to keep messages that may not have been consumed, before deleting from storage. // * @param createdAt. Time when destination was created. +// * @param options. Options user can choose for the destination, not used currently. // * // // Attributes: @@ -1337,7 +1338,7 @@ type DestinationDescription struct { // unused fields # 21 to 39 KafkaCluster *string `thrift:"kafkaCluster,40" db:"kafkaCluster" json:"kafkaCluster,omitempty"` KafkaTopics []string `thrift:"kafkaTopics,41" db:"kafkaTopics" json:"kafkaTopics,omitempty"` - Options map[string]bool `thrift:"options,42" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,42" db:"options" json:"options,omitempty"` } func NewDestinationDescription() *DestinationDescription { @@ -1433,9 +1434,9 @@ var DestinationDescription_KafkaTopics_DEFAULT []string func (p *DestinationDescription) GetKafkaTopics() []string { return p.KafkaTopics } -var DestinationDescription_Options_DEFAULT map[string]bool +var DestinationDescription_Options_DEFAULT map[string]string -func (p *DestinationDescription) GetOptions() map[string]bool { +func (p *DestinationDescription) GetOptions() map[string]string { return p.Options } func (p *DestinationDescription) IsSetPath() bool { @@ -1714,7 +1715,7 @@ func (p *DestinationDescription) ReadField42(iprot thrift.TProtocol) error { if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { var _key1 string @@ -1723,8 +1724,8 @@ var _key1 string } else { _key1 = v } -var _val2 bool - if v, err := iprot.ReadBool(); err != nil { +var _val2 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { _val2 = v @@ -1933,13 +1934,13 @@ func (p *DestinationDescription) writeField42(oprot thrift.TProtocol) (err error if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 42); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 42:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -2586,6 +2587,7 @@ func (p *DestinationZoneConfigs) String() string { // - SchemaInfo // - KafkaCluster // - KafkaTopics +// - Options type CreateDestinationRequest struct { Path *string `thrift:"path,1" db:"path" json:"path,omitempty"` Type *DestinationType `thrift:"type,2" db:"type" json:"type,omitempty"` @@ -2601,6 +2603,7 @@ type CreateDestinationRequest struct { // unused fields # 21 to 39 KafkaCluster *string `thrift:"kafkaCluster,40" db:"kafkaCluster" json:"kafkaCluster,omitempty"` KafkaTopics []string `thrift:"kafkaTopics,41" db:"kafkaTopics" json:"kafkaTopics,omitempty"` + Options map[string]string `thrift:"options,42" db:"options" json:"options,omitempty"` } func NewCreateDestinationRequest() *CreateDestinationRequest { @@ -2682,6 +2685,11 @@ var CreateDestinationRequest_KafkaTopics_DEFAULT []string func (p *CreateDestinationRequest) GetKafkaTopics() []string { return p.KafkaTopics } +var CreateDestinationRequest_Options_DEFAULT map[string]string + +func (p *CreateDestinationRequest) GetOptions() map[string]string { + return p.Options +} func (p *CreateDestinationRequest) IsSetPath() bool { return p.Path != nil } @@ -2726,6 +2734,10 @@ func (p *CreateDestinationRequest) IsSetKafkaTopics() bool { return p.KafkaTopics != nil } +func (p *CreateDestinationRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *CreateDestinationRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -2783,6 +2795,10 @@ func (p *CreateDestinationRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField41(iprot); err != nil { return err } + case 42: + if err := p.ReadField42(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2910,6 +2926,34 @@ var _elem4 string return nil } +func (p *CreateDestinationRequest) ReadField42(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key5 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key5 = v +} +var _val6 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val6 = v +} + p.Options[_key5] = _val6 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *CreateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("CreateDestinationRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -2925,6 +2969,7 @@ func (p *CreateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField20(oprot); err != nil { return err } if err := p.writeField40(oprot); err != nil { return err } if err := p.writeField41(oprot); err != nil { return err } + if err := p.writeField42(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -3075,6 +3120,28 @@ func (p *CreateDestinationRequest) writeField41(oprot thrift.TProtocol) (err err return err } +func (p *CreateDestinationRequest) writeField42(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 42); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 42:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 42:options: ", p), err) } + } + return err +} + func (p *CreateDestinationRequest) String() string { if p == nil { return "" @@ -3185,6 +3252,7 @@ func (p *ReadDestinationRequest) String() string { // - ChecksumOption // - SchemaInfo // - ZoneConfigs +// - Options type UpdateDestinationRequest struct { Path *string `thrift:"path,1" db:"path" json:"path,omitempty"` Status *DestinationStatus `thrift:"status,2" db:"status" json:"status,omitempty"` @@ -3195,6 +3263,7 @@ type UpdateDestinationRequest struct { // unused fields # 7 to 9 SchemaInfo *SchemaInfo `thrift:"schemaInfo,10" db:"schemaInfo" json:"schemaInfo,omitempty"` ZoneConfigs *DestinationZoneConfigs `thrift:"zoneConfigs,11" db:"zoneConfigs" json:"zoneConfigs,omitempty"` + Options map[string]string `thrift:"options,12" db:"options" json:"options,omitempty"` } func NewUpdateDestinationRequest() *UpdateDestinationRequest { @@ -3257,6 +3326,11 @@ func (p *UpdateDestinationRequest) GetZoneConfigs() *DestinationZoneConfigs { } return p.ZoneConfigs } +var UpdateDestinationRequest_Options_DEFAULT map[string]string + +func (p *UpdateDestinationRequest) GetOptions() map[string]string { + return p.Options +} func (p *UpdateDestinationRequest) IsSetPath() bool { return p.Path != nil } @@ -3289,6 +3363,10 @@ func (p *UpdateDestinationRequest) IsSetZoneConfigs() bool { return p.ZoneConfigs != nil } +func (p *UpdateDestinationRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *UpdateDestinationRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -3334,6 +3412,10 @@ func (p *UpdateDestinationRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField11(iprot); err != nil { return err } + case 12: + if err := p.ReadField12(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -3421,6 +3503,34 @@ func (p *UpdateDestinationRequest) ReadField11(iprot thrift.TProtocol) error { return nil } +func (p *UpdateDestinationRequest) ReadField12(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key7 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key7 = v +} +var _val8 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val8 = v +} + p.Options[_key7] = _val8 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *UpdateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("UpdateDestinationRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -3433,6 +3543,7 @@ func (p *UpdateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField6(oprot); err != nil { return err } if err := p.writeField10(oprot); err != nil { return err } if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField12(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -3539,6 +3650,28 @@ func (p *UpdateDestinationRequest) writeField11(oprot thrift.TProtocol) (err err return err } +func (p *UpdateDestinationRequest) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:options: ", p), err) } + } + return err +} + func (p *UpdateDestinationRequest) String() string { if p == nil { return "" @@ -3884,13 +4017,13 @@ func (p *ListDestinationsResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*DestinationDescription, 0, size) p.Destinations = tSlice for i := 0; i < size; i ++ { - _elem5 := &DestinationDescription{ + _elem9 := &DestinationDescription{ ChecksumOption: 0, } - if err := _elem5.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) } - p.Destinations = append(p.Destinations, _elem5) + p.Destinations = append(p.Destinations, _elem9) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3974,8 +4107,9 @@ func (p *ListDestinationsResult_) String() string { // @param skipOlderMessagesInSeconds. This is useful for consumers who always wants to keep up and don't care about // backlog older than certain duration. // @param createdAt. Time when ConsumerGroup was registered. -// @param delaySeconds. This specifies that the consumer-group would like every message to be delivered after the +// @param delaySeconds. This specifies that the consumer-group would like every message to be delivered after the // specified delay. +// @param options. Options user can choose for the consumer group, like disable_nack_throtting. // // // Attributes: @@ -4012,7 +4146,7 @@ type ConsumerGroupDescription struct { IsMultiZone *bool `thrift:"isMultiZone,20" db:"isMultiZone" json:"isMultiZone,omitempty"` ZoneConfigs *ConsumerGroupZoneConfigs `thrift:"zoneConfigs,21" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,22" db:"delaySeconds" json:"delaySeconds,omitempty"` - Options map[string]bool `thrift:"options,23" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,23" db:"options" json:"options,omitempty"` } func NewConsumerGroupDescription() *ConsumerGroupDescription { @@ -4124,9 +4258,9 @@ func (p *ConsumerGroupDescription) GetDelaySeconds() int32 { } return *p.DelaySeconds } -var ConsumerGroupDescription_Options_DEFAULT map[string]bool +var ConsumerGroupDescription_Options_DEFAULT map[string]string -func (p *ConsumerGroupDescription) GetOptions() map[string]bool { +func (p *ConsumerGroupDescription) GetOptions() map[string]string { return p.Options } func (p *ConsumerGroupDescription) IsSetDestinationPath() bool { @@ -4426,22 +4560,22 @@ func (p *ConsumerGroupDescription) ReadField23(iprot thrift.TProtocol) error { if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key6 string +var _key10 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key6 = v + _key10 = v } -var _val7 bool - if v, err := iprot.ReadBool(); err != nil { +var _val11 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val7 = v + _val11 = v } - p.Options[_key6] = _val7 + p.Options[_key10] = _val11 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -4662,13 +4796,13 @@ func (p *ConsumerGroupDescription) writeField23(oprot thrift.TProtocol) (err err if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 23); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 23:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -4900,11 +5034,11 @@ func (p *ConsumerGroupZoneConfigs) ReadField10(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.Configs = tSlice for i := 0; i < size; i ++ { - _elem8 := &ConsumerGroupZoneConfig{} - if err := _elem8.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + _elem12 := &ConsumerGroupZoneConfig{} + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) } - p.Configs = append(p.Configs, _elem8) + p.Configs = append(p.Configs, _elem12) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5001,7 +5135,7 @@ type CreateConsumerGroupRequest struct { IsMultiZone *bool `thrift:"isMultiZone,10" db:"isMultiZone" json:"isMultiZone,omitempty"` ZoneConfigs *ConsumerGroupZoneConfigs `thrift:"zoneConfigs,11" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,12" db:"delaySeconds" json:"delaySeconds,omitempty"` - Options map[string]bool `thrift:"options,13" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,13" db:"options" json:"options,omitempty"` } func NewCreateConsumerGroupRequest() *CreateConsumerGroupRequest { @@ -5085,9 +5219,9 @@ func (p *CreateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } -var CreateConsumerGroupRequest_Options_DEFAULT map[string]bool +var CreateConsumerGroupRequest_Options_DEFAULT map[string]string -func (p *CreateConsumerGroupRequest) GetOptions() map[string]bool { +func (p *CreateConsumerGroupRequest) GetOptions() map[string]string { return p.Options } func (p *CreateConsumerGroupRequest) IsSetDestinationPath() bool { @@ -5318,22 +5452,22 @@ func (p *CreateConsumerGroupRequest) ReadField13(iprot thrift.TProtocol) error if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key9 string +var _key13 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key9 = v + _key13 = v } -var _val10 bool - if v, err := iprot.ReadBool(); err != nil { +var _val14 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val10 = v + _val14 = v } - p.Options[_key9] = _val10 + p.Options[_key13] = _val14 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5502,13 +5636,13 @@ func (p *CreateConsumerGroupRequest) writeField13(oprot thrift.TProtocol) (err e if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 13); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -5684,7 +5818,7 @@ type UpdateConsumerGroupRequest struct { ActiveZone *string `thrift:"activeZone,9" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs *ConsumerGroupZoneConfigs `thrift:"zoneConfigs,10" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,11" db:"delaySeconds" json:"delaySeconds,omitempty"` - Options map[string]bool `thrift:"options,12" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,12" db:"options" json:"options,omitempty"` } func NewUpdateConsumerGroupRequest() *UpdateConsumerGroupRequest { @@ -5761,9 +5895,9 @@ func (p *UpdateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } -var UpdateConsumerGroupRequest_Options_DEFAULT map[string]bool +var UpdateConsumerGroupRequest_Options_DEFAULT map[string]string -func (p *UpdateConsumerGroupRequest) GetOptions() map[string]bool { +func (p *UpdateConsumerGroupRequest) GetOptions() map[string]string { return p.Options } func (p *UpdateConsumerGroupRequest) IsSetDestinationPath() bool { @@ -5977,22 +6111,22 @@ func (p *UpdateConsumerGroupRequest) ReadField12(iprot thrift.TProtocol) error if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key11 string +var _key15 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key11 = v + _key15 = v } -var _val12 bool - if v, err := iprot.ReadBool(); err != nil { +var _val16 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val12 = v + _val16 = v } - p.Options[_key11] = _val12 + p.Options[_key15] = _val16 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -6148,13 +6282,13 @@ func (p *UpdateConsumerGroupRequest) writeField12(oprot thrift.TProtocol) (err e if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 12); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -6589,11 +6723,11 @@ func (p *ListConsumerGroupResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupDescription, 0, size) p.ConsumerGroups = tSlice for i := 0; i < size; i ++ { - _elem13 := &ConsumerGroupDescription{} - if err := _elem13.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + _elem17 := &ConsumerGroupDescription{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) } - p.ConsumerGroups = append(p.ConsumerGroups, _elem13) + p.ConsumerGroups = append(p.ConsumerGroups, _elem17) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7167,11 +7301,11 @@ func (p *HostProtocol) ReadField10(iprot thrift.TProtocol) error { tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem14 := &HostAddress{} - if err := _elem14.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + _elem18 := &HostAddress{} + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) } - p.HostAddresses = append(p.HostAddresses, _elem14) + p.HostAddresses = append(p.HostAddresses, _elem18) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7434,11 +7568,11 @@ func (p *ReadDestinationHostsResult_) ReadField1(iprot thrift.TProtocol) error tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem15 := &HostAddress{} - if err := _elem15.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem15), err) + _elem19 := &HostAddress{} + if err := _elem19.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) } - p.HostAddresses = append(p.HostAddresses, _elem15) + p.HostAddresses = append(p.HostAddresses, _elem19) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7454,11 +7588,11 @@ func (p *ReadDestinationHostsResult_) ReadField10(iprot thrift.TProtocol) error tSlice := make([]*HostProtocol, 0, size) p.HostProtocols = tSlice for i := 0; i < size; i ++ { - _elem16 := &HostProtocol{} - if err := _elem16.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + _elem20 := &HostProtocol{} + if err := _elem20.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) } - p.HostProtocols = append(p.HostProtocols, _elem16) + p.HostProtocols = append(p.HostProtocols, _elem20) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7773,11 +7907,11 @@ func (p *ReadPublisherOptionsResult_) ReadField1(iprot thrift.TProtocol) error tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem17 := &HostAddress{} - if err := _elem17.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + _elem21 := &HostAddress{} + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) } - p.HostAddresses = append(p.HostAddresses, _elem17) + p.HostAddresses = append(p.HostAddresses, _elem21) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7793,11 +7927,11 @@ func (p *ReadPublisherOptionsResult_) ReadField10(iprot thrift.TProtocol) error tSlice := make([]*HostProtocol, 0, size) p.HostProtocols = tSlice for i := 0; i < size; i ++ { - _elem18 := &HostProtocol{} - if err := _elem18.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + _elem22 := &HostProtocol{} + if err := _elem22.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) } - p.HostProtocols = append(p.HostProtocols, _elem18) + p.HostProtocols = append(p.HostProtocols, _elem22) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8121,11 +8255,11 @@ func (p *ReadConsumerGroupHostsResult_) ReadField1(iprot thrift.TProtocol) erro tSlice := make([]*HostAddress, 0, size) p.HostAddresses = tSlice for i := 0; i < size; i ++ { - _elem19 := &HostAddress{} - if err := _elem19.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + _elem23 := &HostAddress{} + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) } - p.HostAddresses = append(p.HostAddresses, _elem19) + p.HostAddresses = append(p.HostAddresses, _elem23) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8141,11 +8275,11 @@ func (p *ReadConsumerGroupHostsResult_) ReadField10(iprot thrift.TProtocol) err tSlice := make([]*HostProtocol, 0, size) p.HostProtocols = tSlice for i := 0; i < size; i ++ { - _elem20 := &HostProtocol{} - if err := _elem20.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + _elem24 := &HostProtocol{} + if err := _elem24.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) } - p.HostProtocols = append(p.HostProtocols, _elem20) + p.HostProtocols = append(p.HostProtocols, _elem24) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -8419,19 +8553,19 @@ func (p *PutMessage) ReadField4(iprot thrift.TProtocol) error { tMap := make(map[string]string, size) p.UserContext = tMap for i := 0; i < size; i ++ { -var _key21 string +var _key25 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key21 = v + _key25 = v } -var _val22 string +var _val26 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val22 = v + _val26 = v } - p.UserContext[_key21] = _val22 + p.UserContext[_key25] = _val26 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -8806,19 +8940,19 @@ func (p *PutMessageAck) ReadField5(iprot thrift.TProtocol) error { tMap := make(map[string]string, size) p.UserContext = tMap for i := 0; i < size; i ++ { -var _key23 string +var _key27 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key23 = v + _key27 = v } -var _val24 string +var _val28 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val24 = v + _val28 = v } - p.UserContext[_key23] = _val24 + p.UserContext[_key27] = _val28 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -9062,13 +9196,13 @@ func (p *InvalidAckIdError) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.AckIds = tSlice for i := 0; i < size; i ++ { -var _elem25 string +var _elem29 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem25 = v + _elem29 = v } - p.AckIds = append(p.AckIds, _elem25) + p.AckIds = append(p.AckIds, _elem29) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9084,13 +9218,13 @@ func (p *InvalidAckIdError) ReadField3(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.NackIds = tSlice for i := 0; i < size; i ++ { -var _elem26 string +var _elem30 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem26 = v + _elem30 = v } - p.NackIds = append(p.NackIds, _elem26) + p.NackIds = append(p.NackIds, _elem30) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9498,13 +9632,13 @@ func (p *AckMessagesRequest) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.AckIds = tSlice for i := 0; i < size; i ++ { -var _elem27 string +var _elem31 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem27 = v + _elem31 = v } - p.AckIds = append(p.AckIds, _elem27) + p.AckIds = append(p.AckIds, _elem31) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9520,13 +9654,13 @@ func (p *AckMessagesRequest) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.NackIds = tSlice for i := 0; i < size; i ++ { -var _elem28 string +var _elem32 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem28 = v + _elem32 = v } - p.NackIds = append(p.NackIds, _elem28) + p.NackIds = append(p.NackIds, _elem32) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9852,11 +9986,11 @@ func (p *PutMessageBatchRequest) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]*PutMessage, 0, size) p.Messages = tSlice for i := 0; i < size; i ++ { - _elem29 := &PutMessage{} - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + _elem33 := &PutMessage{} + if err := _elem33.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) } - p.Messages = append(p.Messages, _elem29) + p.Messages = append(p.Messages, _elem33) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9992,11 +10126,11 @@ func (p *PutMessageBatchResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*PutMessageAck, 0, size) p.FailedMessages = tSlice for i := 0; i < size; i ++ { - _elem30 := &PutMessageAck{} - if err := _elem30.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + _elem34 := &PutMessageAck{} + if err := _elem34.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) } - p.FailedMessages = append(p.FailedMessages, _elem30) + p.FailedMessages = append(p.FailedMessages, _elem34) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10012,11 +10146,11 @@ func (p *PutMessageBatchResult_) ReadField2(iprot thrift.TProtocol) error { tSlice := make([]*PutMessageAck, 0, size) p.SuccessMessages = tSlice for i := 0; i < size; i ++ { - _elem31 := &PutMessageAck{} - if err := _elem31.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) + _elem35 := &PutMessageAck{} + if err := _elem35.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) } - p.SuccessMessages = append(p.SuccessMessages, _elem31) + p.SuccessMessages = append(p.SuccessMessages, _elem35) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10357,11 +10491,11 @@ func (p *ReceiveMessageBatchResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerMessage, 0, size) p.Messages = tSlice for i := 0; i < size; i ++ { - _elem32 := &ConsumerMessage{} - if err := _elem32.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + _elem36 := &ConsumerMessage{} + if err := _elem36.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) } - p.Messages = append(p.Messages, _elem32) + p.Messages = append(p.Messages, _elem36) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11306,16 +11440,16 @@ func (p *BFrontendClient) recvHostPort() (value string, err error) { return } if mTypeId == thrift.EXCEPTION { - error33 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error34 error - error34, err = error33.Read(iprot) + error37 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error38 error + error38, err = error37.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error34 + err = error38 return } if mTypeId != thrift.REPLY { @@ -11384,16 +11518,16 @@ func (p *BFrontendClient) recvCreateDestination() (value *DestinationDescription return } if mTypeId == thrift.EXCEPTION { - error35 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error36 error - error36, err = error35.Read(iprot) + error39 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error40 error + error40, err = error39.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error36 + err = error40 return } if mTypeId != thrift.REPLY { @@ -11467,16 +11601,16 @@ func (p *BFrontendClient) recvReadDestination() (value *DestinationDescription, return } if mTypeId == thrift.EXCEPTION { - error37 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error38 error - error38, err = error37.Read(iprot) + error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error42 error + error42, err = error41.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error38 + err = error42 return } if mTypeId != thrift.REPLY { @@ -11550,16 +11684,16 @@ func (p *BFrontendClient) recvUpdateDestination() (value *DestinationDescription return } if mTypeId == thrift.EXCEPTION { - error39 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error40 error - error40, err = error39.Read(iprot) + error43 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error44 error + error44, err = error43.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error40 + err = error44 return } if mTypeId != thrift.REPLY { @@ -11633,16 +11767,16 @@ func (p *BFrontendClient) recvDeleteDestination() (err error) { return } if mTypeId == thrift.EXCEPTION { - error41 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error42 error - error42, err = error41.Read(iprot) + error45 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error46 error + error46, err = error45.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error42 + err = error46 return } if mTypeId != thrift.REPLY { @@ -11715,16 +11849,16 @@ func (p *BFrontendClient) recvListDestinations() (value *ListDestinationsResult_ return } if mTypeId == thrift.EXCEPTION { - error43 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error44 error - error44, err = error43.Read(iprot) + error47 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error48 error + error48, err = error47.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error44 + err = error48 return } if mTypeId != thrift.REPLY { @@ -11797,16 +11931,16 @@ func (p *BFrontendClient) recvCreateConsumerGroup() (value *ConsumerGroupDescrip return } if mTypeId == thrift.EXCEPTION { - error45 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error46 error - error46, err = error45.Read(iprot) + error49 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error50 error + error50, err = error49.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error46 + err = error50 return } if mTypeId != thrift.REPLY { @@ -11880,16 +12014,16 @@ func (p *BFrontendClient) recvReadConsumerGroup() (value *ConsumerGroupDescripti return } if mTypeId == thrift.EXCEPTION { - error47 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error48 error - error48, err = error47.Read(iprot) + error51 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error52 error + error52, err = error51.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error48 + err = error52 return } if mTypeId != thrift.REPLY { @@ -11963,16 +12097,16 @@ func (p *BFrontendClient) recvUpdateConsumerGroup() (value *ConsumerGroupDescrip return } if mTypeId == thrift.EXCEPTION { - error49 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error50 error - error50, err = error49.Read(iprot) + error53 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error54 error + error54, err = error53.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error50 + err = error54 return } if mTypeId != thrift.REPLY { @@ -12046,16 +12180,16 @@ func (p *BFrontendClient) recvDeleteConsumerGroup() (err error) { return } if mTypeId == thrift.EXCEPTION { - error51 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error52 error - error52, err = error51.Read(iprot) + error55 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error56 error + error56, err = error55.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error52 + err = error56 return } if mTypeId != thrift.REPLY { @@ -12128,16 +12262,16 @@ func (p *BFrontendClient) recvListConsumerGroups() (value *ListConsumerGroupResu return } if mTypeId == thrift.EXCEPTION { - error53 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error54 error - error54, err = error53.Read(iprot) + error57 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error58 error + error58, err = error57.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error54 + err = error58 return } if mTypeId != thrift.REPLY { @@ -12211,16 +12345,16 @@ func (p *BFrontendClient) recvReadDestinationHosts() (value *ReadDestinationHost return } if mTypeId == thrift.EXCEPTION { - error55 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error56 error - error56, err = error55.Read(iprot) + error59 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error60 error + error60, err = error59.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error56 + err = error60 return } if mTypeId != thrift.REPLY { @@ -12297,16 +12431,16 @@ func (p *BFrontendClient) recvReadPublisherOptions() (value *ReadPublisherOption return } if mTypeId == thrift.EXCEPTION { - error57 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error58 error - error58, err = error57.Read(iprot) + error61 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error62 error + error62, err = error61.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error58 + err = error62 return } if mTypeId != thrift.REPLY { @@ -12383,16 +12517,16 @@ func (p *BFrontendClient) recvReadConsumerGroupHosts() (value *ReadConsumerGroup return } if mTypeId == thrift.EXCEPTION { - error59 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error60 error - error60, err = error59.Read(iprot) + error63 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error64 error + error64, err = error63.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error60 + err = error64 return } if mTypeId != thrift.REPLY { @@ -12471,16 +12605,16 @@ func (p *BFrontendClient) recvPurgeDLQForConsumerGroup() (err error) { return } if mTypeId == thrift.EXCEPTION { - error61 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error62 error - error62, err = error61.Read(iprot) + error65 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error66 error + error66, err = error65.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error62 + err = error66 return } if mTypeId != thrift.REPLY { @@ -12553,16 +12687,16 @@ func (p *BFrontendClient) recvMergeDLQForConsumerGroup() (err error) { return } if mTypeId == thrift.EXCEPTION { - error63 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error64 error - error64, err = error63.Read(iprot) + error67 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error68 error + error68, err = error67.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error64 + err = error68 return } if mTypeId != thrift.REPLY { @@ -12637,16 +12771,16 @@ func (p *BFrontendClient) recvGetQueueDepthInfo() (value *GetQueueDepthInfoResul return } if mTypeId == thrift.EXCEPTION { - error65 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error66 error - error66, err = error65.Read(iprot) + error69 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error70 error + error70, err = error69.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error66 + err = error70 return } if mTypeId != thrift.REPLY { @@ -12692,25 +12826,25 @@ func (p *BFrontendProcessor) ProcessorMap() map[string]thrift.TProcessorFunction func NewBFrontendProcessor(handler BFrontend) *BFrontendProcessor { - self67 := &BFrontendProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self67.processorMap["HostPort"] = &bFrontendProcessorHostPort{handler:handler} - self67.processorMap["createDestination"] = &bFrontendProcessorCreateDestination{handler:handler} - self67.processorMap["readDestination"] = &bFrontendProcessorReadDestination{handler:handler} - self67.processorMap["updateDestination"] = &bFrontendProcessorUpdateDestination{handler:handler} - self67.processorMap["deleteDestination"] = &bFrontendProcessorDeleteDestination{handler:handler} - self67.processorMap["listDestinations"] = &bFrontendProcessorListDestinations{handler:handler} - self67.processorMap["createConsumerGroup"] = &bFrontendProcessorCreateConsumerGroup{handler:handler} - self67.processorMap["readConsumerGroup"] = &bFrontendProcessorReadConsumerGroup{handler:handler} - self67.processorMap["updateConsumerGroup"] = &bFrontendProcessorUpdateConsumerGroup{handler:handler} - self67.processorMap["deleteConsumerGroup"] = &bFrontendProcessorDeleteConsumerGroup{handler:handler} - self67.processorMap["listConsumerGroups"] = &bFrontendProcessorListConsumerGroups{handler:handler} - self67.processorMap["readDestinationHosts"] = &bFrontendProcessorReadDestinationHosts{handler:handler} - self67.processorMap["readPublisherOptions"] = &bFrontendProcessorReadPublisherOptions{handler:handler} - self67.processorMap["readConsumerGroupHosts"] = &bFrontendProcessorReadConsumerGroupHosts{handler:handler} - self67.processorMap["purgeDLQForConsumerGroup"] = &bFrontendProcessorPurgeDLQForConsumerGroup{handler:handler} - self67.processorMap["mergeDLQForConsumerGroup"] = &bFrontendProcessorMergeDLQForConsumerGroup{handler:handler} - self67.processorMap["getQueueDepthInfo"] = &bFrontendProcessorGetQueueDepthInfo{handler:handler} -return self67 + self71 := &BFrontendProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self71.processorMap["HostPort"] = &bFrontendProcessorHostPort{handler:handler} + self71.processorMap["createDestination"] = &bFrontendProcessorCreateDestination{handler:handler} + self71.processorMap["readDestination"] = &bFrontendProcessorReadDestination{handler:handler} + self71.processorMap["updateDestination"] = &bFrontendProcessorUpdateDestination{handler:handler} + self71.processorMap["deleteDestination"] = &bFrontendProcessorDeleteDestination{handler:handler} + self71.processorMap["listDestinations"] = &bFrontendProcessorListDestinations{handler:handler} + self71.processorMap["createConsumerGroup"] = &bFrontendProcessorCreateConsumerGroup{handler:handler} + self71.processorMap["readConsumerGroup"] = &bFrontendProcessorReadConsumerGroup{handler:handler} + self71.processorMap["updateConsumerGroup"] = &bFrontendProcessorUpdateConsumerGroup{handler:handler} + self71.processorMap["deleteConsumerGroup"] = &bFrontendProcessorDeleteConsumerGroup{handler:handler} + self71.processorMap["listConsumerGroups"] = &bFrontendProcessorListConsumerGroups{handler:handler} + self71.processorMap["readDestinationHosts"] = &bFrontendProcessorReadDestinationHosts{handler:handler} + self71.processorMap["readPublisherOptions"] = &bFrontendProcessorReadPublisherOptions{handler:handler} + self71.processorMap["readConsumerGroupHosts"] = &bFrontendProcessorReadConsumerGroupHosts{handler:handler} + self71.processorMap["purgeDLQForConsumerGroup"] = &bFrontendProcessorPurgeDLQForConsumerGroup{handler:handler} + self71.processorMap["mergeDLQForConsumerGroup"] = &bFrontendProcessorMergeDLQForConsumerGroup{handler:handler} + self71.processorMap["getQueueDepthInfo"] = &bFrontendProcessorGetQueueDepthInfo{handler:handler} +return self71 } func (p *BFrontendProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -12721,12 +12855,12 @@ func (p *BFrontendProcessor) Process(iprot, oprot thrift.TProtocol) (success boo } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x68 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x72 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x68.Write(oprot) + x72.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x68 + return false, x72 } @@ -17999,16 +18133,16 @@ func (p *BInClient) recvPutMessageBatch() (value *PutMessageBatchResult_, err er return } if mTypeId == thrift.EXCEPTION { - error165 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error166 error - error166, err = error165.Read(iprot) + error169 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error170 error + error170, err = error169.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error166 + err = error170 return } if mTypeId != thrift.REPLY { @@ -18060,9 +18194,9 @@ func (p *BInProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { func NewBInProcessor(handler BIn) *BInProcessor { - self167 := &BInProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self167.processorMap["putMessageBatch"] = &bInProcessorPutMessageBatch{handler:handler} -return self167 + self171 := &BInProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self171.processorMap["putMessageBatch"] = &bInProcessorPutMessageBatch{handler:handler} +return self171 } func (p *BInProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -18073,12 +18207,12 @@ func (p *BInProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x168 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x172 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x168.Write(oprot) + x172.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x168 + return false, x172 } @@ -18577,16 +18711,16 @@ func (p *BOutClient) recvAckMessages() (err error) { return } if mTypeId == thrift.EXCEPTION { - error175 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error176 error - error176, err = error175.Read(iprot) + error179 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error180 error + error180, err = error179.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error176 + err = error180 return } if mTypeId != thrift.REPLY { @@ -18659,16 +18793,16 @@ func (p *BOutClient) recvSetConsumedMessages() (err error) { return } if mTypeId == thrift.EXCEPTION { - error177 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error178 error - error178, err = error177.Read(iprot) + error181 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error182 error + error182, err = error181.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error178 + err = error182 return } if mTypeId != thrift.REPLY { @@ -18744,16 +18878,16 @@ func (p *BOutClient) recvReceiveMessageBatch() (value *ReceiveMessageBatchResult return } if mTypeId == thrift.EXCEPTION { - error179 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error180 error - error180, err = error179.Read(iprot) + error183 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") + var error184 error + error184, err = error183.Read(iprot) if err != nil { return } if err = iprot.ReadMessageEnd(); err != nil { return } - err = error180 + err = error184 return } if mTypeId != thrift.REPLY { @@ -18805,11 +18939,11 @@ func (p *BOutProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { func NewBOutProcessor(handler BOut) *BOutProcessor { - self181 := &BOutProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self181.processorMap["ackMessages"] = &bOutProcessorAckMessages{handler:handler} - self181.processorMap["setConsumedMessages"] = &bOutProcessorSetConsumedMessages{handler:handler} - self181.processorMap["receiveMessageBatch"] = &bOutProcessorReceiveMessageBatch{handler:handler} -return self181 + self185 := &BOutProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self185.processorMap["ackMessages"] = &bOutProcessorAckMessages{handler:handler} + self185.processorMap["setConsumedMessages"] = &bOutProcessorSetConsumedMessages{handler:handler} + self185.processorMap["receiveMessageBatch"] = &bOutProcessorReceiveMessageBatch{handler:handler} +return self185 } func (p *BOutProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -18820,12 +18954,12 @@ func (p *BOutProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, er } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x182 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x186 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x182.Write(oprot) + x186.Write(oprot) oprot.WriteMessageEnd() oprot.Flush() - return false, x182 + return false, x186 } diff --git a/.generated/go/shared/shared.go b/.generated/go/shared/shared.go index c795cb9..ef47b4b 100644 --- a/.generated/go/shared/shared.go +++ b/.generated/go/shared/shared.go @@ -1559,6 +1559,7 @@ func (p *SchemaInfo) String() string { // - SchemaInfo // - KafkaCluster // - KafkaTopics +// - Options type DestinationDescription struct { Path *string `thrift:"path,1" db:"path" json:"path,omitempty"` DestinationUUID *string `thrift:"destinationUUID,2" db:"destinationUUID" json:"destinationUUID,omitempty"` @@ -1580,6 +1581,7 @@ type DestinationDescription struct { // unused fields # 31 to 39 KafkaCluster *string `thrift:"kafkaCluster,40" db:"kafkaCluster" json:"kafkaCluster,omitempty"` KafkaTopics []string `thrift:"kafkaTopics,41" db:"kafkaTopics" json:"kafkaTopics,omitempty"` + Options map[string]string `thrift:"options,42" db:"options" json:"options,omitempty"` } func NewDestinationDescription() *DestinationDescription { @@ -1694,6 +1696,11 @@ var DestinationDescription_KafkaTopics_DEFAULT []string func (p *DestinationDescription) GetKafkaTopics() []string { return p.KafkaTopics } +var DestinationDescription_Options_DEFAULT map[string]string + +func (p *DestinationDescription) GetOptions() map[string]string { + return p.Options +} func (p *DestinationDescription) IsSetPath() bool { return p.Path != nil } @@ -1758,6 +1765,10 @@ func (p *DestinationDescription) IsSetKafkaTopics() bool { return p.KafkaTopics != nil } +func (p *DestinationDescription) IsSetOptions() bool { + return p.Options != nil +} + func (p *DestinationDescription) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -1835,6 +1846,10 @@ func (p *DestinationDescription) Read(iprot thrift.TProtocol) error { if err := p.ReadField41(iprot); err != nil { return err } + case 42: + if err := p.ReadField42(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -2020,6 +2035,34 @@ var _elem1 string return nil } +func (p *DestinationDescription) ReadField42(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key2 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key2 = v +} +var _val3 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val3 = v +} + p.Options[_key2] = _val3 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *DestinationDescription) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("DestinationDescription"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -2040,6 +2083,7 @@ func (p *DestinationDescription) Write(oprot thrift.TProtocol) error { if err := p.writeField30(oprot); err != nil { return err } if err := p.writeField40(oprot); err != nil { return err } if err := p.writeField41(oprot); err != nil { return err } + if err := p.writeField42(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -2258,6 +2302,28 @@ func (p *DestinationDescription) writeField41(oprot thrift.TProtocol) (err error return err } +func (p *DestinationDescription) writeField42(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 42); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 42:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 42:options: ", p), err) } + } + return err +} + func (p *DestinationDescription) String() string { if p == nil { return "" @@ -2296,7 +2362,7 @@ type CreateDestinationRequest struct { // unused fields # 21 to 39 KafkaCluster *string `thrift:"kafkaCluster,40" db:"kafkaCluster" json:"kafkaCluster,omitempty"` KafkaTopics []string `thrift:"kafkaTopics,41" db:"kafkaTopics" json:"kafkaTopics,omitempty"` - Options map[string]bool `thrift:"options,42" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,42" db:"options" json:"options,omitempty"` } func NewCreateDestinationRequest() *CreateDestinationRequest { @@ -2383,9 +2449,9 @@ var CreateDestinationRequest_KafkaTopics_DEFAULT []string func (p *CreateDestinationRequest) GetKafkaTopics() []string { return p.KafkaTopics } -var CreateDestinationRequest_Options_DEFAULT map[string]bool +var CreateDestinationRequest_Options_DEFAULT map[string]string -func (p *CreateDestinationRequest) GetOptions() map[string]bool { +func (p *CreateDestinationRequest) GetOptions() map[string]string { return p.Options } func (p *CreateDestinationRequest) IsSetPath() bool { @@ -2602,11 +2668,11 @@ func (p *CreateDestinationRequest) ReadField12(iprot thrift.TProtocol) error { tSlice := make([]*DestinationZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem2 := &DestinationZoneConfig{} - if err := _elem2.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + _elem4 := &DestinationZoneConfig{} + if err := _elem4.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem2) + p.ZoneConfigs = append(p.ZoneConfigs, _elem4) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -2639,13 +2705,13 @@ func (p *CreateDestinationRequest) ReadField41(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.KafkaTopics = tSlice for i := 0; i < size; i ++ { -var _elem3 string +var _elem5 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem3 = v + _elem5 = v } - p.KafkaTopics = append(p.KafkaTopics, _elem3) + p.KafkaTopics = append(p.KafkaTopics, _elem5) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -2658,22 +2724,22 @@ func (p *CreateDestinationRequest) ReadField42(iprot thrift.TProtocol) error { if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key4 string +var _key6 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key4 = v + _key6 = v } -var _val5 bool - if v, err := iprot.ReadBool(); err != nil { +var _val7 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val5 = v + _val7 = v } - p.Options[_key4] = _val5 + p.Options[_key6] = _val7 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -2872,13 +2938,13 @@ func (p *CreateDestinationRequest) writeField42(oprot thrift.TProtocol) (err err if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 42); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 42:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -3792,11 +3858,11 @@ func (p *ListDestinationsResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*DestinationDescription, 0, size) p.Destinations = tSlice for i := 0; i < size; i ++ { - _elem6 := &DestinationDescription{} - if err := _elem6.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + _elem8 := &DestinationDescription{} + if err := _elem8.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) } - p.Destinations = append(p.Destinations, _elem6) + p.Destinations = append(p.Destinations, _elem8) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -3876,6 +3942,7 @@ func (p *ListDestinationsResult_) String() string { // - ChecksumOption // - SchemaInfo // - ZoneConfigs +// - Options type UpdateDestinationRequest struct { DestinationUUID *string `thrift:"destinationUUID,1" db:"destinationUUID" json:"destinationUUID,omitempty"` Status *DestinationStatus `thrift:"status,2" db:"status" json:"status,omitempty"` @@ -3886,6 +3953,8 @@ type UpdateDestinationRequest struct { // unused fields # 7 to 9 SchemaInfo *SchemaInfo `thrift:"schemaInfo,10" db:"schemaInfo" json:"schemaInfo,omitempty"` ZoneConfigs []*DestinationZoneConfig `thrift:"zoneConfigs,11" db:"zoneConfigs" json:"zoneConfigs,omitempty"` + // unused field # 12 + Options map[string]string `thrift:"options,13" db:"options" json:"options,omitempty"` } func NewUpdateDestinationRequest() *UpdateDestinationRequest { @@ -3946,6 +4015,11 @@ var UpdateDestinationRequest_ZoneConfigs_DEFAULT []*DestinationZoneConfig func (p *UpdateDestinationRequest) GetZoneConfigs() []*DestinationZoneConfig { return p.ZoneConfigs } +var UpdateDestinationRequest_Options_DEFAULT map[string]string + +func (p *UpdateDestinationRequest) GetOptions() map[string]string { + return p.Options +} func (p *UpdateDestinationRequest) IsSetDestinationUUID() bool { return p.DestinationUUID != nil } @@ -3978,6 +4052,10 @@ func (p *UpdateDestinationRequest) IsSetZoneConfigs() bool { return p.ZoneConfigs != nil } +func (p *UpdateDestinationRequest) IsSetOptions() bool { + return p.Options != nil +} + func (p *UpdateDestinationRequest) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) @@ -4023,6 +4101,10 @@ func (p *UpdateDestinationRequest) Read(iprot thrift.TProtocol) error { if err := p.ReadField11(iprot); err != nil { return err } + case 13: + if err := p.ReadField13(iprot); err != nil { + return err + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -4110,11 +4192,11 @@ func (p *UpdateDestinationRequest) ReadField11(iprot thrift.TProtocol) error { tSlice := make([]*DestinationZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem7 := &DestinationZoneConfig{} - if err := _elem7.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + _elem9 := &DestinationZoneConfig{} + if err := _elem9.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem7) + p.ZoneConfigs = append(p.ZoneConfigs, _elem9) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -4122,6 +4204,34 @@ func (p *UpdateDestinationRequest) ReadField11(iprot thrift.TProtocol) error { return nil } +func (p *UpdateDestinationRequest) ReadField13(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Options = tMap + for i := 0; i < size; i ++ { +var _key10 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key10 = v +} +var _val11 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val11 = v +} + p.Options[_key10] = _val11 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + func (p *UpdateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := oprot.WriteStructBegin("UpdateDestinationRequest"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } @@ -4134,6 +4244,7 @@ func (p *UpdateDestinationRequest) Write(oprot thrift.TProtocol) error { if err := p.writeField6(oprot); err != nil { return err } if err := p.writeField10(oprot); err != nil { return err } if err := p.writeField11(oprot); err != nil { return err } + if err := p.writeField13(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -4248,6 +4359,28 @@ func (p *UpdateDestinationRequest) writeField11(oprot thrift.TProtocol) (err err return err } +func (p *UpdateDestinationRequest) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetOptions() { + if err := oprot.WriteFieldBegin("options", thrift.MAP, 13); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:options: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Options { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:options: ", p), err) } + } + return err +} + func (p *UpdateDestinationRequest) String() string { if p == nil { return "" @@ -4926,7 +5059,7 @@ type ConsumerGroupDescription struct { ActiveZone *string `thrift:"activeZone,22" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs []*ConsumerGroupZoneConfig `thrift:"zoneConfigs,23" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,24" db:"delaySeconds" json:"delaySeconds,omitempty"` - Options map[string]bool `thrift:"options,25" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,25" db:"options" json:"options,omitempty"` } func NewConsumerGroupDescription() *ConsumerGroupDescription { @@ -5036,9 +5169,9 @@ func (p *ConsumerGroupDescription) GetDelaySeconds() int32 { } return *p.DelaySeconds } -var ConsumerGroupDescription_Options_DEFAULT map[string]bool +var ConsumerGroupDescription_Options_DEFAULT map[string]string -func (p *ConsumerGroupDescription) GetOptions() map[string]bool { +func (p *ConsumerGroupDescription) GetOptions() map[string]string { return p.Options } func (p *ConsumerGroupDescription) IsSetConsumerGroupUUID() bool { @@ -5324,11 +5457,11 @@ func (p *ConsumerGroupDescription) ReadField23(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem8 := &ConsumerGroupZoneConfig{} - if err := _elem8.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + _elem12 := &ConsumerGroupZoneConfig{} + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem8) + p.ZoneConfigs = append(p.ZoneConfigs, _elem12) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5350,22 +5483,22 @@ func (p *ConsumerGroupDescription) ReadField25(iprot thrift.TProtocol) error { if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key9 string +var _key13 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key9 = v + _key13 = v } -var _val10 bool - if v, err := iprot.ReadBool(); err != nil { +var _val14 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val10 = v + _val14 = v } - p.Options[_key9] = _val10 + p.Options[_key13] = _val14 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -5594,13 +5727,13 @@ func (p *ConsumerGroupDescription) writeField25(oprot thrift.TProtocol) (err err if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 25); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 25:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -5647,7 +5780,7 @@ type CreateConsumerGroupRequest struct { ActiveZone *string `thrift:"activeZone,12" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs []*ConsumerGroupZoneConfig `thrift:"zoneConfigs,13" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,14" db:"delaySeconds" json:"delaySeconds,omitempty"` - Options map[string]bool `thrift:"options,15" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,15" db:"options" json:"options,omitempty"` } func NewCreateConsumerGroupRequest() *CreateConsumerGroupRequest { @@ -5729,9 +5862,9 @@ func (p *CreateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } -var CreateConsumerGroupRequest_Options_DEFAULT map[string]bool +var CreateConsumerGroupRequest_Options_DEFAULT map[string]string -func (p *CreateConsumerGroupRequest) GetOptions() map[string]bool { +func (p *CreateConsumerGroupRequest) GetOptions() map[string]string { return p.Options } func (p *CreateConsumerGroupRequest) IsSetDestinationPath() bool { @@ -5947,11 +6080,11 @@ func (p *CreateConsumerGroupRequest) ReadField13(iprot thrift.TProtocol) error tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem11 := &ConsumerGroupZoneConfig{} - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + _elem15 := &ConsumerGroupZoneConfig{} + if err := _elem15.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem15), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem11) + p.ZoneConfigs = append(p.ZoneConfigs, _elem15) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -5973,22 +6106,22 @@ func (p *CreateConsumerGroupRequest) ReadField15(iprot thrift.TProtocol) error if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key12 string +var _key16 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key12 = v + _key16 = v } -var _val13 bool - if v, err := iprot.ReadBool(); err != nil { +var _val17 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val13 = v + _val17 = v } - p.Options[_key12] = _val13 + p.Options[_key16] = _val17 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -6165,13 +6298,13 @@ func (p *CreateConsumerGroupRequest) writeField15(oprot thrift.TProtocol) (err e if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 15); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -6350,7 +6483,7 @@ type UpdateConsumerGroupRequest struct { ActiveZone *string `thrift:"activeZone,9" db:"activeZone" json:"activeZone,omitempty"` ZoneConfigs []*ConsumerGroupZoneConfig `thrift:"zoneConfigs,10" db:"zoneConfigs" json:"zoneConfigs,omitempty"` DelaySeconds *int32 `thrift:"delaySeconds,11" db:"delaySeconds" json:"delaySeconds,omitempty"` - Options map[string]bool `thrift:"options,12" db:"options" json:"options,omitempty"` + Options map[string]string `thrift:"options,12" db:"options" json:"options,omitempty"` } func NewUpdateConsumerGroupRequest() *UpdateConsumerGroupRequest { @@ -6432,9 +6565,9 @@ func (p *UpdateConsumerGroupRequest) GetDelaySeconds() int32 { } return *p.DelaySeconds } -var UpdateConsumerGroupRequest_Options_DEFAULT map[string]bool +var UpdateConsumerGroupRequest_Options_DEFAULT map[string]string -func (p *UpdateConsumerGroupRequest) GetOptions() map[string]bool { +func (p *UpdateConsumerGroupRequest) GetOptions() map[string]string { return p.Options } func (p *UpdateConsumerGroupRequest) IsSetDestinationPath() bool { @@ -6651,11 +6784,11 @@ func (p *UpdateConsumerGroupRequest) ReadField10(iprot thrift.TProtocol) error tSlice := make([]*ConsumerGroupZoneConfig, 0, size) p.ZoneConfigs = tSlice for i := 0; i < size; i ++ { - _elem14 := &ConsumerGroupZoneConfig{} - if err := _elem14.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + _elem18 := &ConsumerGroupZoneConfig{} + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) } - p.ZoneConfigs = append(p.ZoneConfigs, _elem14) + p.ZoneConfigs = append(p.ZoneConfigs, _elem18) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -6677,22 +6810,22 @@ func (p *UpdateConsumerGroupRequest) ReadField12(iprot thrift.TProtocol) error if err != nil { return thrift.PrependError("error reading map begin: ", err) } - tMap := make(map[string]bool, size) + tMap := make(map[string]string, size) p.Options = tMap for i := 0; i < size; i ++ { -var _key15 string +var _key19 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key15 = v + _key19 = v } -var _val16 bool - if v, err := iprot.ReadBool(); err != nil { +var _val20 string + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val16 = v + _val20 = v } - p.Options[_key15] = _val16 + p.Options[_key19] = _val20 } if err := iprot.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) @@ -6869,13 +7002,13 @@ func (p *UpdateConsumerGroupRequest) writeField12(oprot thrift.TProtocol) (err e if p.IsSetOptions() { if err := oprot.WriteFieldBegin("options", thrift.MAP, 12); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:options: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.BOOL, len(p.Options)); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Options)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Options { if err := oprot.WriteString(string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteBool(bool(v)); err != nil { + if err := oprot.WriteString(string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } if err := oprot.WriteMapEnd(); err != nil { @@ -7732,11 +7865,11 @@ func (p *ListConsumerGroupResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ConsumerGroupDescription, 0, size) p.ConsumerGroups = tSlice for i := 0; i < size; i ++ { - _elem17 := &ConsumerGroupDescription{} - if err := _elem17.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + _elem21 := &ConsumerGroupDescription{} + if err := _elem21.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) } - p.ConsumerGroups = append(p.ConsumerGroups, _elem17) + p.ConsumerGroups = append(p.ConsumerGroups, _elem21) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -7969,13 +8102,13 @@ func (p *Extent) ReadField3(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.StoreUUIDs = tSlice for i := 0; i < size; i ++ { -var _elem18 string +var _elem22 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem18 = v + _elem22 = v } - p.StoreUUIDs = append(p.StoreUUIDs, _elem18) + p.StoreUUIDs = append(p.StoreUUIDs, _elem22) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9110,11 +9243,11 @@ func (p *ExtentStats) ReadField6(iprot thrift.TProtocol) error { tSlice := make([]*ExtentReplicaStats, 0, size) p.ReplicaStats = tSlice for i := 0; i < size; i ++ { - _elem19 := &ExtentReplicaStats{} - if err := _elem19.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + _elem23 := &ExtentReplicaStats{} + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) } - p.ReplicaStats = append(p.ReplicaStats, _elem19) + p.ReplicaStats = append(p.ReplicaStats, _elem23) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -9569,13 +9702,13 @@ func (p *ConsumerGroupExtent) ReadField6(iprot thrift.TProtocol) error { tSlice := make([]string, 0, size) p.StoreUUIDs = tSlice for i := 0; i < size; i ++ { -var _elem20 string +var _elem24 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem20 = v + _elem24 = v } - p.StoreUUIDs = append(p.StoreUUIDs, _elem20) + p.StoreUUIDs = append(p.StoreUUIDs, _elem24) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10394,11 +10527,11 @@ func (p *ListExtentsStatsResult_) ReadField1(iprot thrift.TProtocol) error { tSlice := make([]*ExtentStats, 0, size) p.ExtentStatsList = tSlice for i := 0; i < size; i ++ { - _elem21 := &ExtentStats{} - if err := _elem21.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) + _elem25 := &ExtentStats{} + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) } - p.ExtentStatsList = append(p.ExtentStatsList, _elem21) + p.ExtentStatsList = append(p.ExtentStatsList, _elem25) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -10632,13 +10765,13 @@ func (p *CreateConsumerGroupExtentRequest) ReadField5(iprot thrift.TProtocol) e tSlice := make([]string, 0, size) p.StoreUUIDs = tSlice for i := 0; i < size; i ++ { -var _elem22 string +var _elem26 string if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem22 = v + _elem26 = v } - p.StoreUUIDs = append(p.StoreUUIDs, _elem22) + p.StoreUUIDs = append(p.StoreUUIDs, _elem26) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -11759,11 +11892,11 @@ func (p *ReadConsumerGroupExtentsResult_) ReadField1(iprot thrift.TProtocol) er tSlice := make([]*ConsumerGroupExtent, 0, size) p.Extents = tSlice for i := 0; i < size; i ++ { - _elem23 := &ConsumerGroupExtent{} - if err := _elem23.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + _elem27 := &ConsumerGroupExtent{} + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) } - p.Extents = append(p.Extents, _elem23) + p.Extents = append(p.Extents, _elem27) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) diff --git a/idl/cherami/cherami.thrift b/idl/cherami/cherami.thrift index 67319b5..967d97f 100644 --- a/idl/cherami/cherami.thrift +++ b/idl/cherami/cherami.thrift @@ -152,7 +152,7 @@ struct DestinationDescription { 20: optional SchemaInfo schemaInfo // Latest schema for this destination 40: optional string kafkaCluster 41: optional list kafkaTopics - 42: optional map options // not used currently + 42: optional map options // not used currently } struct SchemaInfo { @@ -188,7 +188,7 @@ struct CreateDestinationRequest { 20: optional SchemaInfo schemaInfo 40: optional string kafkaCluster 41: optional list kafkaTopics - 42: optional map options // not used currently + 42: optional map options // not used currently } struct ReadDestinationRequest { @@ -204,7 +204,7 @@ struct UpdateDestinationRequest { 6: optional ChecksumOption checksumOption 10: optional SchemaInfo schemaInfo 11: optional DestinationZoneConfigs zoneConfigs - 12: optional map options // not used currently + 12: optional map options // not used currently } struct DeleteDestinationRequest { @@ -256,7 +256,7 @@ struct ConsumerGroupDescription { 20: optional bool isMultiZone 21: optional ConsumerGroupZoneConfigs zoneConfigs 22: optional i32 delaySeconds - 23: optional map options + 23: optional map options } struct ConsumerGroupZoneConfig { @@ -283,7 +283,7 @@ struct CreateConsumerGroupRequest { 10: optional bool isMultiZone 11: optional ConsumerGroupZoneConfigs zoneConfigs 12: optional i32 delaySeconds - 13: optional map options + 13: optional map options } struct ReadConsumerGroupRequest { @@ -302,7 +302,7 @@ struct UpdateConsumerGroupRequest { 9: optional string activeZone 10: optional ConsumerGroupZoneConfigs zoneConfigs 11: optional i32 delaySeconds - 12: optional map options; + 12: optional map options; } struct DeleteConsumerGroupRequest { diff --git a/idl/cherami_server/shared.thrift b/idl/cherami_server/shared.thrift index d94545b..d6af7ad 100644 --- a/idl/cherami_server/shared.thrift +++ b/idl/cherami_server/shared.thrift @@ -158,7 +158,7 @@ struct DestinationDescription { 30: optional SchemaInfo schemaInfo // Latest schema for this destination 40: optional string kafkaCluster 41: optional list kafkaTopics - 42: optional map options + 42: optional map options } struct CreateDestinationRequest { @@ -175,7 +175,7 @@ struct CreateDestinationRequest { 20: optional SchemaInfo schemaInfo 40: optional string kafkaCluster 41: optional list kafkaTopics - 42: optional map options + 42: optional map options } struct CreateDestinationUUIDRequest { @@ -225,7 +225,7 @@ struct UpdateDestinationRequest { 6: optional ChecksumOption checksumOption 10: optional SchemaInfo schemaInfo 11: optional list zoneConfigs - 13: optional map options + 13: optional map options } struct DeleteDestinationRequest { @@ -268,7 +268,7 @@ struct ConsumerGroupDescription { 22: optional string activeZone 23: optional list zoneConfigs 24: optional i32 delaySeconds - 25: optional map options + 25: optional map options } struct CreateConsumerGroupRequest { @@ -285,7 +285,7 @@ struct CreateConsumerGroupRequest { 12: optional string activeZone 13: optional list zoneConfigs 14: optional i32 delaySeconds - 15: optional map options + 15: optional map options } struct CreateConsumerGroupUUIDRequest { @@ -305,7 +305,7 @@ struct UpdateConsumerGroupRequest { 9: optional string activeZone 10: optional list zoneConfigs 11: optional i32 delaySeconds - 12: optional map options + 12: optional map options } struct DeleteConsumerGroupRequest {