README

Insertion Ordered Set

Pipeline status Pipeline status Coverage report Go Report Card GoDoc Reference

Implementation of an insertion ordered set in Go

Installation

go get go.bmvs.io/orderedset

Usage

package main

import (
	"go.bmvs.io/orderedset"
)

func main() {
	m := orderedset.New()
	m.Add("bar")
	// ...
}

See the godoc to see all the available methods with example usage.

Development

  • Install dependencies with dep
  • Run tests with go test -race ./...

License

BSD-2-Clause

Expand ▾ Collapse ▴

Documentation

Overview

    Package orderedset implements a thread safe insertion ordered set backed by an ordered map.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type OrderedSet

    type OrderedSet struct {
    	sync.Mutex
    	// contains filtered or unexported fields
    }

      OrderedSet insertion ordered Set implementation

      func New

      func New() *OrderedSet

        New return a new Set implemented by OrderedSet

        func (*OrderedSet) Add

        func (s *OrderedSet) Add(items ...interface{})

          Add add items to the OrderedSet

          func (*OrderedSet) Contains

          func (s *OrderedSet) Contains(items ...interface{}) bool

            Contains return if OrderedSet contains the specified items or not

            func (*OrderedSet) Empty

            func (s *OrderedSet) Empty() bool

              Empty return if the OrderedSet in empty or not

              func (*OrderedSet) Remove

              func (s *OrderedSet) Remove(items ...interface{})

                Remove remove items from the OrderedSet

                func (*OrderedSet) Size

                func (s *OrderedSet) Size() int

                  Size return the size of the OrderedSet

                  func (*OrderedSet) Values

                  func (s *OrderedSet) Values() []interface{}

                    Values return the values of the OrderedSet in insertion order

                    Source Files