github.com/lirm/aeron-go@v0.0.0-20230415210743-920325491dc4/archive/codecs/ListRecordingsRequest.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 ListRecordingsRequest struct { 13 ControlSessionId int64 14 CorrelationId int64 15 FromRecordingId int64 16 RecordCount int32 17 } 18 19 func (l *ListRecordingsRequest) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { 20 if doRangeCheck { 21 if err := l.RangeCheck(l.SbeSchemaVersion(), l.SbeSchemaVersion()); err != nil { 22 return err 23 } 24 } 25 if err := _m.WriteInt64(_w, l.ControlSessionId); err != nil { 26 return err 27 } 28 if err := _m.WriteInt64(_w, l.CorrelationId); err != nil { 29 return err 30 } 31 if err := _m.WriteInt64(_w, l.FromRecordingId); err != nil { 32 return err 33 } 34 if err := _m.WriteInt32(_w, l.RecordCount); err != nil { 35 return err 36 } 37 return nil 38 } 39 40 func (l *ListRecordingsRequest) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { 41 if !l.ControlSessionIdInActingVersion(actingVersion) { 42 l.ControlSessionId = l.ControlSessionIdNullValue() 43 } else { 44 if err := _m.ReadInt64(_r, &l.ControlSessionId); err != nil { 45 return err 46 } 47 } 48 if !l.CorrelationIdInActingVersion(actingVersion) { 49 l.CorrelationId = l.CorrelationIdNullValue() 50 } else { 51 if err := _m.ReadInt64(_r, &l.CorrelationId); err != nil { 52 return err 53 } 54 } 55 if !l.FromRecordingIdInActingVersion(actingVersion) { 56 l.FromRecordingId = l.FromRecordingIdNullValue() 57 } else { 58 if err := _m.ReadInt64(_r, &l.FromRecordingId); err != nil { 59 return err 60 } 61 } 62 if !l.RecordCountInActingVersion(actingVersion) { 63 l.RecordCount = l.RecordCountNullValue() 64 } else { 65 if err := _m.ReadInt32(_r, &l.RecordCount); err != nil { 66 return err 67 } 68 } 69 if actingVersion > l.SbeSchemaVersion() && blockLength > l.SbeBlockLength() { 70 io.CopyN(ioutil.Discard, _r, int64(blockLength-l.SbeBlockLength())) 71 } 72 if doRangeCheck { 73 if err := l.RangeCheck(actingVersion, l.SbeSchemaVersion()); err != nil { 74 return err 75 } 76 } 77 return nil 78 } 79 80 func (l *ListRecordingsRequest) RangeCheck(actingVersion uint16, schemaVersion uint16) error { 81 if l.ControlSessionIdInActingVersion(actingVersion) { 82 if l.ControlSessionId < l.ControlSessionIdMinValue() || l.ControlSessionId > l.ControlSessionIdMaxValue() { 83 return fmt.Errorf("Range check failed on l.ControlSessionId (%v < %v > %v)", l.ControlSessionIdMinValue(), l.ControlSessionId, l.ControlSessionIdMaxValue()) 84 } 85 } 86 if l.CorrelationIdInActingVersion(actingVersion) { 87 if l.CorrelationId < l.CorrelationIdMinValue() || l.CorrelationId > l.CorrelationIdMaxValue() { 88 return fmt.Errorf("Range check failed on l.CorrelationId (%v < %v > %v)", l.CorrelationIdMinValue(), l.CorrelationId, l.CorrelationIdMaxValue()) 89 } 90 } 91 if l.FromRecordingIdInActingVersion(actingVersion) { 92 if l.FromRecordingId < l.FromRecordingIdMinValue() || l.FromRecordingId > l.FromRecordingIdMaxValue() { 93 return fmt.Errorf("Range check failed on l.FromRecordingId (%v < %v > %v)", l.FromRecordingIdMinValue(), l.FromRecordingId, l.FromRecordingIdMaxValue()) 94 } 95 } 96 if l.RecordCountInActingVersion(actingVersion) { 97 if l.RecordCount < l.RecordCountMinValue() || l.RecordCount > l.RecordCountMaxValue() { 98 return fmt.Errorf("Range check failed on l.RecordCount (%v < %v > %v)", l.RecordCountMinValue(), l.RecordCount, l.RecordCountMaxValue()) 99 } 100 } 101 return nil 102 } 103 104 func ListRecordingsRequestInit(l *ListRecordingsRequest) { 105 return 106 } 107 108 func (*ListRecordingsRequest) SbeBlockLength() (blockLength uint16) { 109 return 28 110 } 111 112 func (*ListRecordingsRequest) SbeTemplateId() (templateId uint16) { 113 return 8 114 } 115 116 func (*ListRecordingsRequest) SbeSchemaId() (schemaId uint16) { 117 return 101 118 } 119 120 func (*ListRecordingsRequest) SbeSchemaVersion() (schemaVersion uint16) { 121 return 6 122 } 123 124 func (*ListRecordingsRequest) SbeSemanticType() (semanticType []byte) { 125 return []byte("") 126 } 127 128 func (*ListRecordingsRequest) ControlSessionIdId() uint16 { 129 return 1 130 } 131 132 func (*ListRecordingsRequest) ControlSessionIdSinceVersion() uint16 { 133 return 0 134 } 135 136 func (l *ListRecordingsRequest) ControlSessionIdInActingVersion(actingVersion uint16) bool { 137 return actingVersion >= l.ControlSessionIdSinceVersion() 138 } 139 140 func (*ListRecordingsRequest) ControlSessionIdDeprecated() uint16 { 141 return 0 142 } 143 144 func (*ListRecordingsRequest) ControlSessionIdMetaAttribute(meta int) string { 145 switch meta { 146 case 1: 147 return "" 148 case 2: 149 return "" 150 case 3: 151 return "" 152 case 4: 153 return "required" 154 } 155 return "" 156 } 157 158 func (*ListRecordingsRequest) ControlSessionIdMinValue() int64 { 159 return math.MinInt64 + 1 160 } 161 162 func (*ListRecordingsRequest) ControlSessionIdMaxValue() int64 { 163 return math.MaxInt64 164 } 165 166 func (*ListRecordingsRequest) ControlSessionIdNullValue() int64 { 167 return math.MinInt64 168 } 169 170 func (*ListRecordingsRequest) CorrelationIdId() uint16 { 171 return 2 172 } 173 174 func (*ListRecordingsRequest) CorrelationIdSinceVersion() uint16 { 175 return 0 176 } 177 178 func (l *ListRecordingsRequest) CorrelationIdInActingVersion(actingVersion uint16) bool { 179 return actingVersion >= l.CorrelationIdSinceVersion() 180 } 181 182 func (*ListRecordingsRequest) CorrelationIdDeprecated() uint16 { 183 return 0 184 } 185 186 func (*ListRecordingsRequest) CorrelationIdMetaAttribute(meta int) string { 187 switch meta { 188 case 1: 189 return "" 190 case 2: 191 return "" 192 case 3: 193 return "" 194 case 4: 195 return "required" 196 } 197 return "" 198 } 199 200 func (*ListRecordingsRequest) CorrelationIdMinValue() int64 { 201 return math.MinInt64 + 1 202 } 203 204 func (*ListRecordingsRequest) CorrelationIdMaxValue() int64 { 205 return math.MaxInt64 206 } 207 208 func (*ListRecordingsRequest) CorrelationIdNullValue() int64 { 209 return math.MinInt64 210 } 211 212 func (*ListRecordingsRequest) FromRecordingIdId() uint16 { 213 return 3 214 } 215 216 func (*ListRecordingsRequest) FromRecordingIdSinceVersion() uint16 { 217 return 0 218 } 219 220 func (l *ListRecordingsRequest) FromRecordingIdInActingVersion(actingVersion uint16) bool { 221 return actingVersion >= l.FromRecordingIdSinceVersion() 222 } 223 224 func (*ListRecordingsRequest) FromRecordingIdDeprecated() uint16 { 225 return 0 226 } 227 228 func (*ListRecordingsRequest) FromRecordingIdMetaAttribute(meta int) string { 229 switch meta { 230 case 1: 231 return "" 232 case 2: 233 return "" 234 case 3: 235 return "" 236 case 4: 237 return "required" 238 } 239 return "" 240 } 241 242 func (*ListRecordingsRequest) FromRecordingIdMinValue() int64 { 243 return math.MinInt64 + 1 244 } 245 246 func (*ListRecordingsRequest) FromRecordingIdMaxValue() int64 { 247 return math.MaxInt64 248 } 249 250 func (*ListRecordingsRequest) FromRecordingIdNullValue() int64 { 251 return math.MinInt64 252 } 253 254 func (*ListRecordingsRequest) RecordCountId() uint16 { 255 return 4 256 } 257 258 func (*ListRecordingsRequest) RecordCountSinceVersion() uint16 { 259 return 0 260 } 261 262 func (l *ListRecordingsRequest) RecordCountInActingVersion(actingVersion uint16) bool { 263 return actingVersion >= l.RecordCountSinceVersion() 264 } 265 266 func (*ListRecordingsRequest) RecordCountDeprecated() uint16 { 267 return 0 268 } 269 270 func (*ListRecordingsRequest) RecordCountMetaAttribute(meta int) string { 271 switch meta { 272 case 1: 273 return "" 274 case 2: 275 return "" 276 case 3: 277 return "" 278 case 4: 279 return "required" 280 } 281 return "" 282 } 283 284 func (*ListRecordingsRequest) RecordCountMinValue() int32 { 285 return math.MinInt32 + 1 286 } 287 288 func (*ListRecordingsRequest) RecordCountMaxValue() int32 { 289 return math.MaxInt32 290 } 291 292 func (*ListRecordingsRequest) RecordCountNullValue() int32 { 293 return math.MinInt32 294 }