Skip to content
/ gwrap Public

Golang generic wrappers for core library functions

License

Notifications You must be signed in to change notification settings

muir/gwrap

Repository files navigation

gwrap - golang generic wrappers for standard library functions

GoDoc unit tests report card codecov

Install:

go get github.com/muir/gwrap

This package is a collection of generic functions that wrap standard library functions. Hopefully, this packge will quickly become obsolete because the library functions will support generics directly. Until then, there is this.

SyncMap

SyncMap is a wrapper around sync.Map supporting the go 1.18 sync.Map

CompareMap

CompareMap is a wrapper around sync.Map supporting the go 1.20 sync.Map. CompareMap is only available when compiling with go 1.20 and above.

AtomicValue

AtomicValue is a wrapper around sync/atomic.Value.

SyncPool

SyncPool is a wrapper for sync.Pool

Heap

Heap is a heap-like wrapper for container/heap

PriorityQueue

PriorityQueue is a wrapper for container/heap that implements priority queues.

PriorityQueue supports removing arbitrary items from the queue at any point. To support that, the items in the queue must implement the PQItem interface. The simplest way to implement that interface is to embed PQItemEmbed in the items that will be in the priority queue.

About

Golang generic wrappers for core library functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages