unmarshal decompresses and unmarshals the results from json
(buffer []byte)
| 54 | |
| 55 | // unmarshal decompresses and unmarshals the results from json |
| 56 | func (b *TenantIndex) unmarshal(buffer []byte) error { |
| 57 | gzipReader, err := gzip.NewReader(bytes.NewReader(buffer)) |
| 58 | if err != nil { |
| 59 | return err |
| 60 | } |
| 61 | defer gzipReader.Close() |
| 62 | |
| 63 | d := json.NewDecoder(gzipReader) |
| 64 | return d.Decode(b) |
| 65 | } |
| 66 | |
| 67 | func (b *TenantIndex) marshalPb() ([]byte, error) { |
| 68 | pbBytes, err := proto.Marshal(b) |