Documentation ¶
Overview ¶
Use morass when you don't want your data to be a quagmire.
Sort data larger than can fit in memory.
morass məˈras/ 1. An area of muddy or boggy ground. 2. A complicated or confused situation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LessInterface ¶
type LessInterface interface {
Less(i interface{}) bool
}
Is the receiver less than the parameterised interface
type Morass ¶
Type to manage sorting very large data sets. Setting AutoClean to true causes the Morass to delete temporary sort files when they are depleted.
func New ¶
Create a new Morass. prefix and dir are passed to ioutil.TempDir. chunkSize specifies the amount of sorting to be done in memory, concurrent specifies that temporary file writing occurs concurrently with sorting. An error is returned if no temporary directory can be created. Note that the type is registered with the underlying gob encoder using the name ℳn, where n is a sequentially assigned integer string, when the type registered. This is done to avoid using too much space and will cause problems when using gob itself on this type. If you intend use gob itself with this the type, preregister with gob and morass will use the existing registration.
func (*Morass) CleanUp ¶
Delete the file system components of the Morass. After this call the Morass is not usable. Returns any error that occurs.
func (*Morass) Finalise ¶
Indicate that the last element has been pushed on to the Morass and write out final data. Returns any error that occurs.
func (*Morass) Pull ¶
func (m *Morass) Pull(e LessInterface) error
Set the settable value e to the lowest value in the Morass. io.EOF indicate the Morass is empty. Any other error results in no value being set on e.
func (*Morass) Push ¶
func (m *Morass) Push(e LessInterface) error
Push a value on to the Morass. Returns any error that occurs.