Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NotComparable error = errors.New("Not Comparable")
Functions ¶
This section is empty.
Types ¶
type Comparer ¶
type Comparer interface { // Compare yourself to something. If the values are not comparable, // returns negative if the first argument is “less” than the second, zero // if they are “equal”, and positive if the first argument is “greater” // returns 0, and an error of "Not Comparable" if not comparable Compare(interface{}) (int, error) }
type Goroutree ¶
type Goroutree struct {
// contains filtered or unexported fields
}
Goroutree is a tree set represented by a set of running goroutines, one per node in the tree. It is essentially an actor-based tree that holds machine-sized integers. The tree is unbalanced and does no rotations, so a series of inserts and deletes can make it very unbalanced. The tree is not going to be bombproof (because this is for a blog post) and probably has some obvious races.
func (*Goroutree) Contains ¶
Contains will tell if the set contains the given value. The channel passed will receive a true if the value does exist in the set and a false if not.
func (*Goroutree) Delete ¶
Delete removes a value from the tree set if it exists. The channel passed will receive a true if the value did exist in the set and a false if not.