github.com/lirm/aeron-go@v0.0.0-20230415210743-920325491dc4/archive/codecs/ListRecordingSubscriptionsRequest.go (about) 1 // Generated SBE (Simple Binary Encoding) message codec 2 3 package codecs 4 5 import ( 6 "fmt" 7 "io" 8 "io/ioutil" 9 "math" 10 ) 11 12 type ListRecordingSubscriptionsRequest struct { 13 ControlSessionId int64 14 CorrelationId int64 15 PseudoIndex int32 16 SubscriptionCount int32 17 ApplyStreamId BooleanTypeEnum 18 StreamId int32 19 Channel []uint8 20 } 21 22 func (l *ListRecordingSubscriptionsRequest) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { 23 if doRangeCheck { 24 if err := l.RangeCheck(l.SbeSchemaVersion(), l.SbeSchemaVersion()); err != nil { 25 return err 26 } 27 } 28 if err := _m.WriteInt64(_w, l.ControlSessionId); err != nil { 29 return err 30 } 31 if err := _m.WriteInt64(_w, l.CorrelationId); err != nil { 32 return err 33 } 34 if err := _m.WriteInt32(_w, l.PseudoIndex); err != nil { 35 return err 36 } 37 if err := _m.WriteInt32(_w, l.SubscriptionCount); err != nil { 38 return err 39 } 40 if err := l.ApplyStreamId.Encode(_m, _w); err != nil { 41 return err 42 } 43 if err := _m.WriteInt32(_w, l.StreamId); err != nil { 44 return err 45 } 46 if err := _m.WriteUint32(_w, uint32(len(l.Channel))); err != nil { 47 return err 48 } 49 if err := _m.WriteBytes(_w, l.Channel); err != nil { 50 return err 51 } 52 return nil 53 } 54 55 func (l *ListRecordingSubscriptionsRequest) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { 56 if !l.ControlSessionIdInActingVersion(actingVersion) { 57 l.ControlSessionId = l.ControlSessionIdNullValue() 58 } else { 59 if err := _m.ReadInt64(_r, &l.ControlSessionId); err != nil { 60 return err 61 } 62 } 63 if !l.CorrelationIdInActingVersion(actingVersion) { 64 l.CorrelationId = l.CorrelationIdNullValue() 65 } else { 66 if err := _m.ReadInt64(_r, &l.CorrelationId); err != nil { 67 return err 68 } 69 } 70 if !l.PseudoIndexInActingVersion(actingVersion) { 71 l.PseudoIndex = l.PseudoIndexNullValue() 72 } else { 73 if err := _m.ReadInt32(_r, &l.PseudoIndex); err != nil { 74 return err 75 } 76 } 77 if !l.SubscriptionCountInActingVersion(actingVersion) { 78 l.SubscriptionCount = l.SubscriptionCountNullValue() 79 } else { 80 if err := _m.ReadInt32(_r, &l.SubscriptionCount); err != nil { 81 return err 82 } 83 } 84 if l.ApplyStreamIdInActingVersion(actingVersion) { 85 if err := l.ApplyStreamId.Decode(_m, _r, actingVersion); err != nil { 86 return err 87 } 88 } 89 if !l.StreamIdInActingVersion(actingVersion) { 90 l.StreamId = l.StreamIdNullValue() 91 } else { 92 if err := _m.ReadInt32(_r, &l.StreamId); err != nil { 93 return err 94 } 95 } 96 if actingVersion > l.SbeSchemaVersion() && blockLength > l.SbeBlockLength() { 97 io.CopyN(ioutil.Discard, _r, int64(blockLength-l.SbeBlockLength())) 98 } 99 100 if l.ChannelInActingVersion(actingVersion) { 101 var ChannelLength uint32 102 if err := _m.ReadUint32(_r, &ChannelLength); err != nil { 103 return err 104 } 105 if cap(l.Channel) < int(ChannelLength) { 106 l.Channel = make([]uint8, ChannelLength) 107 } 108 l.Channel = l.Channel[:ChannelLength] 109 if err := _m.ReadBytes(_r, l.Channel); err != nil { 110 return err 111 } 112 } 113 if doRangeCheck { 114 if err := l.RangeCheck(actingVersion, l.SbeSchemaVersion()); err != nil { 115 return err 116 } 117 } 118 return nil 119 } 120 121 func (l *ListRecordingSubscriptionsRequest) RangeCheck(actingVersion uint16, schemaVersion uint16) error { 122 if l.ControlSessionIdInActingVersion(actingVersion) { 123 if l.ControlSessionId < l.ControlSessionIdMinValue() || l.ControlSessionId > l.ControlSessionIdMaxValue() { 124 return fmt.Errorf("Range check failed on l.ControlSessionId (%v < %v > %v)", l.ControlSessionIdMinValue(), l.ControlSessionId, l.ControlSessionIdMaxValue()) 125 } 126 } 127 if l.CorrelationIdInActingVersion(actingVersion) { 128 if l.CorrelationId < l.CorrelationIdMinValue() || l.CorrelationId > l.CorrelationIdMaxValue() { 129 return fmt.Errorf("Range check failed on l.CorrelationId (%v < %v > %v)", l.CorrelationIdMinValue(), l.CorrelationId, l.CorrelationIdMaxValue()) 130 } 131 } 132 if l.PseudoIndexInActingVersion(actingVersion) { 133 if l.PseudoIndex < l.PseudoIndexMinValue() || l.PseudoIndex > l.PseudoIndexMaxValue() { 134 return fmt.Errorf("Range check failed on l.PseudoIndex (%v < %v > %v)", l.PseudoIndexMinValue(), l.PseudoIndex, l.PseudoIndexMaxValue()) 135 } 136 } 137 if l.SubscriptionCountInActingVersion(actingVersion) { 138 if l.SubscriptionCount < l.SubscriptionCountMinValue() || l.SubscriptionCount > l.SubscriptionCountMaxValue() { 139 return fmt.Errorf("Range check failed on l.SubscriptionCount (%v < %v > %v)", l.SubscriptionCountMinValue(), l.SubscriptionCount, l.SubscriptionCountMaxValue()) 140 } 141 } 142 if err := l.ApplyStreamId.RangeCheck(actingVersion, schemaVersion); err != nil { 143 return err 144 } 145 if l.StreamIdInActingVersion(actingVersion) { 146 if l.StreamId < l.StreamIdMinValue() || l.StreamId > l.StreamIdMaxValue() { 147 return fmt.Errorf("Range check failed on l.StreamId (%v < %v > %v)", l.StreamIdMinValue(), l.StreamId, l.StreamIdMaxValue()) 148 } 149 } 150 return nil 151 } 152 153 func ListRecordingSubscriptionsRequestInit(l *ListRecordingSubscriptionsRequest) { 154 return 155 } 156 157 func (*ListRecordingSubscriptionsRequest) SbeBlockLength() (blockLength uint16) { 158 return 32 159 } 160 161 func (*ListRecordingSubscriptionsRequest) SbeTemplateId() (templateId uint16) { 162 return 17 163 } 164 165 func (*ListRecordingSubscriptionsRequest) SbeSchemaId() (schemaId uint16) { 166 return 101 167 } 168 169 func (*ListRecordingSubscriptionsRequest) SbeSchemaVersion() (schemaVersion uint16) { 170 return 6 171 } 172 173 func (*ListRecordingSubscriptionsRequest) SbeSemanticType() (semanticType []byte) { 174 return []byte("") 175 } 176 177 func (*ListRecordingSubscriptionsRequest) ControlSessionIdId() uint16 { 178 return 1 179 } 180 181 func (*ListRecordingSubscriptionsRequest) ControlSessionIdSinceVersion() uint16 { 182 return 0 183 } 184 185 func (l *ListRecordingSubscriptionsRequest) ControlSessionIdInActingVersion(actingVersion uint16) bool { 186 return actingVersion >= l.ControlSessionIdSinceVersion() 187 } 188 189 func (*ListRecordingSubscriptionsRequest) ControlSessionIdDeprecated() uint16 { 190 return 0 191 } 192 193 func (*ListRecordingSubscriptionsRequest) ControlSessionIdMetaAttribute(meta int) string { 194 switch meta { 195 case 1: 196 return "" 197 case 2: 198 return "" 199 case 3: 200 return "" 201 case 4: 202 return "required" 203 } 204 return "" 205 } 206 207 func (*ListRecordingSubscriptionsRequest) ControlSessionIdMinValue() int64 { 208 return math.MinInt64 + 1 209 } 210 211 func (*ListRecordingSubscriptionsRequest) ControlSessionIdMaxValue() int64 { 212 return math.MaxInt64 213 } 214 215 func (*ListRecordingSubscriptionsRequest) ControlSessionIdNullValue() int64 { 216 return math.MinInt64 217 } 218 219 func (*ListRecordingSubscriptionsRequest) CorrelationIdId() uint16 { 220 return 2 221 } 222 223 func (*ListRecordingSubscriptionsRequest) CorrelationIdSinceVersion() uint16 { 224 return 0 225 } 226 227 func (l *ListRecordingSubscriptionsRequest) CorrelationIdInActingVersion(actingVersion uint16) bool { 228 return actingVersion >= l.CorrelationIdSinceVersion() 229 } 230 231 func (*ListRecordingSubscriptionsRequest) CorrelationIdDeprecated() uint16 { 232 return 0 233 } 234 235 func (*ListRecordingSubscriptionsRequest) CorrelationIdMetaAttribute(meta int) string { 236 switch meta { 237 case 1: 238 return "" 239 case 2: 240 return "" 241 case 3: 242 return "" 243 case 4: 244 return "required" 245 } 246 return "" 247 } 248 249 func (*ListRecordingSubscriptionsRequest) CorrelationIdMinValue() int64 { 250 return math.MinInt64 + 1 251 } 252 253 func (*ListRecordingSubscriptionsRequest) CorrelationIdMaxValue() int64 { 254 return math.MaxInt64 255 } 256 257 func (*ListRecordingSubscriptionsRequest) CorrelationIdNullValue() int64 { 258 return math.MinInt64 259 } 260 261 func (*ListRecordingSubscriptionsRequest) PseudoIndexId() uint16 { 262 return 3 263 } 264 265 func (*ListRecordingSubscriptionsRequest) PseudoIndexSinceVersion() uint16 { 266 return 0 267 } 268 269 func (l *ListRecordingSubscriptionsRequest) PseudoIndexInActingVersion(actingVersion uint16) bool { 270 return actingVersion >= l.PseudoIndexSinceVersion() 271 } 272 273 func (*ListRecordingSubscriptionsRequest) PseudoIndexDeprecated() uint16 { 274 return 0 275 } 276 277 func (*ListRecordingSubscriptionsRequest) PseudoIndexMetaAttribute(meta int) string { 278 switch meta { 279 case 1: 280 return "" 281 case 2: 282 return "" 283 case 3: 284 return "" 285 case 4: 286 return "required" 287 } 288 return "" 289 } 290 291 func (*ListRecordingSubscriptionsRequest) PseudoIndexMinValue() int32 { 292 return math.MinInt32 + 1 293 } 294 295 func (*ListRecordingSubscriptionsRequest) PseudoIndexMaxValue() int32 { 296 return math.MaxInt32 297 } 298 299 func (*ListRecordingSubscriptionsRequest) PseudoIndexNullValue() int32 { 300 return math.MinInt32 301 } 302 303 func (*ListRecordingSubscriptionsRequest) SubscriptionCountId() uint16 { 304 return 4 305 } 306 307 func (*ListRecordingSubscriptionsRequest) SubscriptionCountSinceVersion() uint16 { 308 return 0 309 } 310 311 func (l *ListRecordingSubscriptionsRequest) SubscriptionCountInActingVersion(actingVersion uint16) bool { 312 return actingVersion >= l.SubscriptionCountSinceVersion() 313 } 314 315 func (*ListRecordingSubscriptionsRequest) SubscriptionCountDeprecated() uint16 { 316 return 0 317 } 318 319 func (*ListRecordingSubscriptionsRequest) SubscriptionCountMetaAttribute(meta int) string { 320 switch meta { 321 case 1: 322 return "" 323 case 2: 324 return "" 325 case 3: 326 return "" 327 case 4: 328 return "required" 329 } 330 return "" 331 } 332 333 func (*ListRecordingSubscriptionsRequest) SubscriptionCountMinValue() int32 { 334 return math.MinInt32 + 1 335 } 336 337 func (*ListRecordingSubscriptionsRequest) SubscriptionCountMaxValue() int32 { 338 return math.MaxInt32 339 } 340 341 func (*ListRecordingSubscriptionsRequest) SubscriptionCountNullValue() int32 { 342 return math.MinInt32 343 } 344 345 func (*ListRecordingSubscriptionsRequest) ApplyStreamIdId() uint16 { 346 return 5 347 } 348 349 func (*ListRecordingSubscriptionsRequest) ApplyStreamIdSinceVersion() uint16 { 350 return 0 351 } 352 353 func (l *ListRecordingSubscriptionsRequest) ApplyStreamIdInActingVersion(actingVersion uint16) bool { 354 return actingVersion >= l.ApplyStreamIdSinceVersion() 355 } 356 357 func (*ListRecordingSubscriptionsRequest) ApplyStreamIdDeprecated() uint16 { 358 return 0 359 } 360 361 func (*ListRecordingSubscriptionsRequest) ApplyStreamIdMetaAttribute(meta int) string { 362 switch meta { 363 case 1: 364 return "" 365 case 2: 366 return "" 367 case 3: 368 return "" 369 case 4: 370 return "required" 371 } 372 return "" 373 } 374 375 func (*ListRecordingSubscriptionsRequest) StreamIdId() uint16 { 376 return 6 377 } 378 379 func (*ListRecordingSubscriptionsRequest) StreamIdSinceVersion() uint16 { 380 return 0 381 } 382 383 func (l *ListRecordingSubscriptionsRequest) StreamIdInActingVersion(actingVersion uint16) bool { 384 return actingVersion >= l.StreamIdSinceVersion() 385 } 386 387 func (*ListRecordingSubscriptionsRequest) StreamIdDeprecated() uint16 { 388 return 0 389 } 390 391 func (*ListRecordingSubscriptionsRequest) StreamIdMetaAttribute(meta int) string { 392 switch meta { 393 case 1: 394 return "" 395 case 2: 396 return "" 397 case 3: 398 return "" 399 case 4: 400 return "required" 401 } 402 return "" 403 } 404 405 func (*ListRecordingSubscriptionsRequest) StreamIdMinValue() int32 { 406 return math.MinInt32 + 1 407 } 408 409 func (*ListRecordingSubscriptionsRequest) StreamIdMaxValue() int32 { 410 return math.MaxInt32 411 } 412 413 func (*ListRecordingSubscriptionsRequest) StreamIdNullValue() int32 { 414 return math.MinInt32 415 } 416 417 func (*ListRecordingSubscriptionsRequest) ChannelMetaAttribute(meta int) string { 418 switch meta { 419 case 1: 420 return "" 421 case 2: 422 return "" 423 case 3: 424 return "" 425 case 4: 426 return "required" 427 } 428 return "" 429 } 430 431 func (*ListRecordingSubscriptionsRequest) ChannelSinceVersion() uint16 { 432 return 0 433 } 434 435 func (l *ListRecordingSubscriptionsRequest) ChannelInActingVersion(actingVersion uint16) bool { 436 return actingVersion >= l.ChannelSinceVersion() 437 } 438 439 func (*ListRecordingSubscriptionsRequest) ChannelDeprecated() uint16 { 440 return 0 441 } 442 443 func (ListRecordingSubscriptionsRequest) ChannelCharacterEncoding() string { 444 return "US-ASCII" 445 } 446 447 func (ListRecordingSubscriptionsRequest) ChannelHeaderLength() uint64 { 448 return 4 449 }