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