README

Insertion Ordered Map

Pipeline status Pipeline status Coverage report Go Report Card GoDoc Reference

Implementation of an insertion ordered map in Go

Installation

go get go.bmvs.io/orderedmap

Usage

package main

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

func main() {
	m := orderedmap.New()
	m.Put("foo", "bar")
	// ...
}

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

Development

  • Run tests with go test -race ./...

License

BSD-2-Clause

Expand ▾ Collapse ▴

Documentation

Overview

    Package orderedmap implements a thread safe insertion ordered map.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type OrderedMap

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

      OrderedMap insertion ordered Map implementation

      func New

      func New() *OrderedMap

        New return a new Map implemented by OrderedMap

        func (*OrderedMap) Empty

        func (m *OrderedMap) Empty() bool

          Empty return if the OrderedMap in empty or not

          func (*OrderedMap) Get

          func (m *OrderedMap) Get(key interface{}) (value interface{}, found bool)

            Get return the value of a key from the OrderedMap

            func (*OrderedMap) Keys

            func (m *OrderedMap) Keys() []interface{}

              Keys return the keys of the OrderedMap in insertion order

              func (*OrderedMap) Put

              func (m *OrderedMap) Put(key, value interface{})

                Put add a key-value pair to the OrderedMap

                func (*OrderedMap) Remove

                func (m *OrderedMap) Remove(key interface{})

                  Remove remove a key-value pair from the OrderedMap

                  func (*OrderedMap) Size

                  func (m *OrderedMap) Size() int

                    Size return the size of the OrderedMap

                    func (*OrderedMap) Values

                    func (m *OrderedMap) Values() []interface{}

                      Values return the values of the OrderedMap in insertion order

                      Source Files