init initializes the prefix queue data.
()
| 451 | |
| 452 | // init initializes the prefix queue data. |
| 453 | func (pq *PrefixQueue) init() error { |
| 454 | // Get the main prefix queue data. |
| 455 | val, err := pq.db.Get(pq.getDataKey(), nil) |
| 456 | if err == errors.ErrNotFound { |
| 457 | return nil |
| 458 | } else if err != nil { |
| 459 | return err |
| 460 | } |
| 461 | |
| 462 | pq.size = binary.BigEndian.Uint64(val) |
| 463 | return nil |
| 464 | } |
| 465 | |
| 466 | // generateKeyPrefixData generates a data key using the given prefix. This key |
| 467 | // should be used to get the stored queue struct for the given prefix. |
no test coverage detected