MCPcopy Create free account
hub / github.com/beeker1121/goque / init

Method init

prefix_queue.go:453–464  ·  view source on GitHub ↗

init initializes the prefix queue data.

()

Source from the content-addressed store, hash-verified

451
452// init initializes the prefix queue data.
453func (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.

Callers 1

OpenPrefixQueueFunction · 0.95

Calls 1

getDataKeyMethod · 0.95

Tested by

no test coverage detected