Documentation
¶
Overview ¶
Package utils holds the list of code helpers
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMMapIsClosed means that it was an attempt to read data // from the closed region ErrMMapIsClosed = errors.New("MMap file is closed") // ErrMMapInvalidOffset means that it was an attempt to read data // from the invalid offset ErrMMapInvalidOffset = errors.New("out of range") )
Functions ¶
func UnpackLeft ¶
UnpackLeft explodes uint64 into 2 uint32 and returns the first uint32 value
func UnpackRight ¶
UnpackRight explodes uint64 into 2 uint32 and returns the second uint32 value
Types ¶
type AtomicFloat64 ¶
type AtomicFloat64 struct {
// contains filtered or unexported fields
}
AtomicFloat64 is an atomic wrapper around float64 inspired https://github.com/uber-go/atomic/blob/master/atomic.go
func (*AtomicFloat64) Load ¶
func (u *AtomicFloat64) Load() float64
Load atomically loads stored float64 value
func (*AtomicFloat64) Store ¶
func (u *AtomicFloat64) Store(val float64)
Store atomically stores float64 value
type MMapReader ¶
type MMapReader struct {
// contains filtered or unexported fields
}
MMapReader wraps Read methods by using mmap
func NewMMapReader ¶
func NewMMapReader(filename string) (*MMapReader, error)
NewMMapReader returns new instance of MMapReader
func (*MMapReader) Bytes ¶
func (r *MMapReader) Bytes() ([]byte, error)
Bytes returns a mapped region of data
func (*MMapReader) Close ¶
func (r *MMapReader) Close() error
Close releases unmap of the chosen region
Click to show internal directories.
Click to hide internal directories.