khezen / struct

Data structures for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status codecov

GoDoc collection

import "github.com/khezen/struct/collection"

Exposes base collection interface and mixing operations(union, intersection, etc...)

type Interface interface {
	Add(...interface{})
	Remove(...interface{})
	Replace(item, substitute interface{})
	Has(...interface{}) bool
	Each(func(item interface{}) bool)

	Len() int
	Clear()
	IsEmpty() bool
	IsEqual(Interface) bool

	Merge(Interface)
	Separate(Interface)
	Retain(Interface)

	String() string
	Slice() []interface{}
	CopyCollection() Interface
}
func Union(collections ...Interface) Interface
func Difference(collections ...Interface) Interface
func Intersection(collections ...Interface) Interface
func Exclusion(collections ...Interface) Interface

GoDoc array

import "github.com/khezen/struct/array"

Abstraction layer over slices exposing utility functions and synchronized implementation of dynamic array.

GoDoc set

import "github.com/khezen/struct/set"

Both synchronized and non-synchronized implementations of a generic set data structure.

GoDoc ordered set

import "github.com/khezen/struct/oset"

Both synchronized and non-synchronized implementations of a generic ordered set data structure.

GoDoc hashmap

import "github.com/khezen/struct/hashmap"

Both synchronized and non-synchronized implementations of a generic hashmap data structure.

About

Data structures for Go

License:MIT License


Languages

Language:Go 99.4%Language:Shell 0.6%