fs2: github.com/timtadh/fs2/mmlist Index | Files

package mmlist

import "github.com/timtadh/fs2/mmlist"

A Memory Mapped List. This list works more like a stack and less like a queue. It is not a good thing to build a job queue on. It is a good thing to build a large set of items which can be efficiently randomly sampled. It uses the same `varchar` system that the B+Tree uses so it can store variably sized items up to 2^31 - 1 bytes long.


1. `Size` O(1)

2. `Append` O(1)

3. `Pop` O(1)

4. `Get` O(1)

5. `Set` O(1)

6. `Swap` O(1)

7. `SwapDelete` O(1)


Package Files


type List Uses

type List struct {
    // contains filtered or unexported fields

func New Uses

func New(bf *fmap.BlockFile) (*List, error)

func NewAt Uses

func NewAt(bf *fmap.BlockFile, ctrl_a uint64) (*List, error)

func Open Uses

func Open(bf *fmap.BlockFile) (*List, error)

func OpenAt Uses

func OpenAt(bf *fmap.BlockFile, ctrl_a uint64) (*List, error)

func (*List) Append Uses

func (l *List) Append(item []byte) (i uint64, err error)

func (*List) Get Uses

func (l *List) Get(i uint64) (item []byte, err error)

func (*List) Pop Uses

func (l *List) Pop() (item []byte, err error)

func (*List) Set Uses

func (l *List) Set(i uint64, item []byte) (err error)

func (*List) Size Uses

func (l *List) Size() uint64

func (*List) Swap Uses

func (l *List) Swap(i, j uint64) (err error)

func (*List) SwapDelete Uses

func (l *List) SwapDelete(i uint64) (item []byte, err error)

Package mmlist imports 7 packages (graph). Updated 2016-07-22. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).