https://github.com/khezen/struct
Data structures for Go
https://github.com/khezen/struct
array arraylist collection go golang hashmap ordered-set set
Last synced: 9 days ago
JSON representation
Data structures for Go
- Host: GitHub
- URL: https://github.com/khezen/struct
- Owner: khezen
- License: mit
- Archived: true
- Created: 2017-03-25T10:09:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T19:57:31.000Z (about 7 years ago)
- Last Synced: 2024-06-20T06:38:00.745Z (over 1 year ago)
- Topics: array, arraylist, collection, go, golang, hashmap, ordered-set, set
- Language: Go
- Homepage:
- Size: 71.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/khezen/struct) [](https://codecov.io/gh/khezen/struct)
# [](https://godoc.org/github.com/khezen/struct/collection) *collection*
`
import "github.com/khezen/struct/collection"
`
Exposes base collection interface and mixing operations(union, intersection, etc...)
```golang
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
}
```
```golang
func Union(collections ...Interface) Interface
```
```golang
func Difference(collections ...Interface) Interface
```
```golang
func Intersection(collections ...Interface) Interface
```
```golang
func Exclusion(collections ...Interface) Interface
```
# [](https://godoc.org/github.com/khezen/struct/array) *array*
`
import "github.com/khezen/struct/array"
`
Abstraction layer over slices exposing utility functions and synchronized implementation of dynamic array.
# [](https://godoc.org/github.com/khezen/struct/set) *set*
`
import "github.com/khezen/struct/set"
`
Both synchronized and non-synchronized implementations of a generic set data structure.
# [](https://godoc.org/github.com/khezen/struct/oset) *ordered set*
`
import "github.com/khezen/struct/oset"
`
Both synchronized and non-synchronized implementations of a generic ordered set data structure.
# [](https://godoc.org/github.com/khezen/struct/hashmap) *hashmap*
`
import "github.com/khezen/struct/hashmap"
`
Both synchronized and non-synchronized implementations of a generic
hashmap data structure.