| 316 | } |
| 317 | |
| 318 | func (enc *Encoder) WriteHashMapObject(key string, hash map[string][]byte, options ...interface{}) error { |
| 319 | err := enc.beforeWriteObject(options...) |
| 320 | if err != nil { |
| 321 | return err |
| 322 | } |
| 323 | ok, err := enc.tryWriteZipListHashMap(key, hash, options...) |
| 324 | if err != nil { |
| 325 | return err |
| 326 | } |
| 327 | if !ok { |
| 328 | err = enc.writeHashEncoding(key, hash, options...) |
| 329 | if err != nil { |
| 330 | return err |
| 331 | } |
| 332 | } |
| 333 | enc.state = writtenObjectState |
| 334 | return nil |
| 335 | } |
| 336 | |
| 337 | func (enc *Encoder) WriteHashMapObjectEx(key string, hash map[string][]byte, expire map[string]int64, options ...interface{}) error { |
| 338 | err := enc.beforeWriteObject(options...) |