github.com/lirm/aeron-go@v0.0.0-20230415210743-920325491dc4/archive/codecs/ListRecordingRequest.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 ListRecordingRequest struct { 13 ControlSessionId int64 14 CorrelationId int64 15 RecordingId int64 16 } 17 18 func (l *ListRecordingRequest) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { 19 if doRangeCheck { 20 if err := l.RangeCheck(l.SbeSchemaVersion(), l.SbeSchemaVersion()); err != nil { 21 return err 22 } 23 } 24 if err := _m.WriteInt64(_w, l.ControlSessionId); err != nil { 25 return err 26 } 27 if err := _m.WriteInt64(_w, l.CorrelationId); err != nil { 28 return err 29 } 30 if err := _m.WriteInt64(_w, l.RecordingId); err != nil { 31 return err 32 } 33 return nil 34 } 35 36 func (l *ListRecordingRequest) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { 37 if !l.ControlSessionIdInActingVersion(actingVersion) { 38 l.ControlSessionId = l.ControlSessionIdNullValue() 39 } else { 40 if err := _m.ReadInt64(_r, &l.ControlSessionId); err != nil { 41 return err 42 } 43 } 44 if !l.CorrelationIdInActingVersion(actingVersion) { 45 l.CorrelationId = l.CorrelationIdNullValue() 46 } else { 47 if err := _m.ReadInt64(_r, &l.CorrelationId); err != nil { 48 return err 49 } 50 } 51 if !l.RecordingIdInActingVersion(actingVersion) { 52 l.RecordingId = l.RecordingIdNullValue() 53 } else { 54 if err := _m.ReadInt64(_r, &l.RecordingId); err != nil { 55 return err 56 } 57 } 58 if actingVersion > l.SbeSchemaVersion() && blockLength > l.SbeBlockLength() { 59 io.CopyN(ioutil.Discard, _r, int64(blockLength-l.SbeBlockLength())) 60 } 61 if doRangeCheck { 62 if err := l.RangeCheck(actingVersion, l.SbeSchemaVersion()); err != nil { 63 return err 64 } 65 } 66 return nil 67 } 68 69 func (l *ListRecordingRequest) RangeCheck(actingVersion uint16, schemaVersion uint16) error { 70 if l.ControlSessionIdInActingVersion(actingVersion) { 71 if l.ControlSessionId < l.ControlSessionIdMinValue() || l.ControlSessionId > l.ControlSessionIdMaxValue() { 72 return fmt.Errorf("Range check failed on l.ControlSessionId (%v < %v > %v)", l.ControlSessionIdMinValue(), l.ControlSessionId, l.ControlSessionIdMaxValue()) 73 } 74 } 75 if l.CorrelationIdInActingVersion(actingVersion) { 76 if l.CorrelationId < l.CorrelationIdMinValue() || l.CorrelationId > l.CorrelationIdMaxValue() { 77 return fmt.Errorf("Range check failed on l.CorrelationId (%v < %v > %v)", l.CorrelationIdMinValue(), l.CorrelationId, l.CorrelationIdMaxValue()) 78 } 79 } 80 if l.RecordingIdInActingVersion(actingVersion) { 81 if l.RecordingId < l.RecordingIdMinValue() || l.RecordingId > l.RecordingIdMaxValue() { 82 return fmt.Errorf("Range check failed on l.RecordingId (%v < %v > %v)", l.RecordingIdMinValue(), l.RecordingId, l.RecordingIdMaxValue()) 83 } 84 } 85 return nil 86 } 87 88 func ListRecordingRequestInit(l *ListRecordingRequest) { 89 return 90 } 91 92 func (*ListRecordingRequest) SbeBlockLength() (blockLength uint16) { 93 return 24 94 } 95 96 func (*ListRecordingRequest) SbeTemplateId() (templateId uint16) { 97 return 10 98 } 99 100 func (*ListRecordingRequest) SbeSchemaId() (schemaId uint16) { 101 return 101 102 } 103 104 func (*ListRecordingRequest) SbeSchemaVersion() (schemaVersion uint16) { 105 return 6 106 } 107 108 func (*ListRecordingRequest) SbeSemanticType() (semanticType []byte) { 109 return []byte("") 110 } 111 112 func (*ListRecordingRequest) ControlSessionIdId() uint16 { 113 return 1 114 } 115 116 func (*ListRecordingRequest) ControlSessionIdSinceVersion() uint16 { 117 return 0 118 } 119 120 func (l *ListRecordingRequest) ControlSessionIdInActingVersion(actingVersion uint16) bool { 121 return actingVersion >= l.ControlSessionIdSinceVersion() 122 } 123 124 func (*ListRecordingRequest) ControlSessionIdDeprecated() uint16 { 125 return 0 126 } 127 128 func (*ListRecordingRequest) ControlSessionIdMetaAttribute(meta int) string { 129 switch meta { 130 case 1: 131 return "" 132 case 2: 133 return "" 134 case 3: 135 return "" 136 case 4: 137 return "required" 138 } 139 return "" 140 } 141 142 func (*ListRecordingRequest) ControlSessionIdMinValue() int64 { 143 return math.MinInt64 + 1 144 } 145 146 func (*ListRecordingRequest) ControlSessionIdMaxValue() int64 { 147 return math.MaxInt64 148 } 149 150 func (*ListRecordingRequest) ControlSessionIdNullValue() int64 { 151 return math.MinInt64 152 } 153 154 func (*ListRecordingRequest) CorrelationIdId() uint16 { 155 return 2 156 } 157 158 func (*ListRecordingRequest) CorrelationIdSinceVersion() uint16 { 159 return 0 160 } 161 162 func (l *ListRecordingRequest) CorrelationIdInActingVersion(actingVersion uint16) bool { 163 return actingVersion >= l.CorrelationIdSinceVersion() 164 } 165 166 func (*ListRecordingRequest) CorrelationIdDeprecated() uint16 { 167 return 0 168 } 169 170 func (*ListRecordingRequest) CorrelationIdMetaAttribute(meta int) string { 171 switch meta { 172 case 1: 173 return "" 174 case 2: 175 return "" 176 case 3: 177 return "" 178 case 4: 179 return "required" 180 } 181 return "" 182 } 183 184 func (*ListRecordingRequest) CorrelationIdMinValue() int64 { 185 return math.MinInt64 + 1 186 } 187 188 func (*ListRecordingRequest) CorrelationIdMaxValue() int64 { 189 return math.MaxInt64 190 } 191 192 func (*ListRecordingRequest) CorrelationIdNullValue() int64 { 193 return math.MinInt64 194 } 195 196 func (*ListRecordingRequest) RecordingIdId() uint16 { 197 return 3 198 } 199 200 func (*ListRecordingRequest) RecordingIdSinceVersion() uint16 { 201 return 0 202 } 203 204 func (l *ListRecordingRequest) RecordingIdInActingVersion(actingVersion uint16) bool { 205 return actingVersion >= l.RecordingIdSinceVersion() 206 } 207 208 func (*ListRecordingRequest) RecordingIdDeprecated() uint16 { 209 return 0 210 } 211 212 func (*ListRecordingRequest) RecordingIdMetaAttribute(meta int) string { 213 switch meta { 214 case 1: 215 return "" 216 case 2: 217 return "" 218 case 3: 219 return "" 220 case 4: 221 return "required" 222 } 223 return "" 224 } 225 226 func (*ListRecordingRequest) RecordingIdMinValue() int64 { 227 return math.MinInt64 + 1 228 } 229 230 func (*ListRecordingRequest) RecordingIdMaxValue() int64 { 231 return math.MaxInt64 232 } 233 234 func (*ListRecordingRequest) RecordingIdNullValue() int64 { 235 return math.MinInt64 236 }