capacityset

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2019 License: Apache-2.0 Imports: 2 Imported by: 1

README

capacityset

Capacityset provides a set with a maximum size.

Build Status codecov.io Code Climate Issue Count Go Report Card Apache V2 License GitHub release GoDoc

Summary

Capacityset implements a set (unordered, non-repeating) that cannot exceed a provisioned size.

Install

This repo is a package. There is no installation.

Contributing

Refer to CONTRIBUTING.md.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendToChannel

func SendToChannel(f func() interface{}) <-chan interface{}

Types

type Set

type Set interface {
	// Adds an element to the set. Returns whether
	// the item was added.
	Add(item interface{}) bool

	// Pop returns an item from the set
	Pop() interface{}

	// Size returns the number of items in the set
	Size() int
}

Set is the interface of the common set storage pattern

func NewCapacitySet

func NewCapacitySet(capacity int) Set

NewCapacitySet returns the set interface with max capacity allowing of a set with cap

Jump to

Keyboard shortcuts

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