queue

package
v0.0.0-...-9c46a49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

This implements a simple linked list Queue. Nothing complicated. The queue is thread safe and easy to use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(data []byte) []byte

Generate a sha256 hash of the data

Types

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(allowDups bool) *Queue

Construct a new queue

func (*Queue) Deque

func (self *Queue) Deque() (data []byte, err error)

Read data off the queue in FIFO order

func (*Queue) Empty

func (self *Queue) Empty() bool

Check to see if it empty

func (*Queue) Enque

func (self *Queue) Enque(data []byte) error

Put data on the queue

func (*Queue) Has

func (self *Queue) Has(hash []byte) bool

func (*Queue) Size

func (self *Queue) Size() int

How many items are on the queue?

func (*Queue) String

func (self *Queue) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL