()
| 44 | } |
| 45 | |
| 46 | func (e *sessionCacheEntry) MarshalBinary() (data []byte, err error) { |
| 47 | buf := new(bytes.Buffer) |
| 48 | _, _ = buf.Write(uintToVarintBytes(uint(len(e.formatVersion)))) |
| 49 | _, _ = buf.WriteString(e.formatVersion) |
| 50 | _, _ = buf.Write(uintToVarintBytes(uint(len(e.ticket)))) |
| 51 | _, _ = buf.Write(e.ticket) |
| 52 | _, _ = buf.Write(uintToVarintBytes(uint(len(e.state)))) |
| 53 | _, _ = buf.Write(e.state) |
| 54 | return append([]byte(nil), buf.Bytes()...), nil |
| 55 | } |
| 56 | |
| 57 | func (e *sessionCacheEntry) UnmarshalBinary(data []byte) error { |
| 58 | r := bytes.NewReader(data) |
no test coverage detected