Skip to content
This repository has been archived by the owner on Feb 23, 2019. It is now read-only.

khezen/struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.