Documentation
¶
Overview ¶
Provides file-backed collections.
File backing for collections. File format:
Length: 8 (uint64) | kind: 2 (uint16) | size: 8 (uint64) | object: n (gob encoded) | ...
Provides file-backed list.
// // New list. list := fb.NewList()
// // Append an object. list.Append(object)
// // Iterate the list. itr := list.Iter()
for { object, hasNext := itr.Next() if !hasNext { break } ... }
// // Iterate the list. itr := list.Iter()
for object, hasNext := itr.Next(); hasNext; object, hasNext = itr.Next() { ... }
// // Iterate the list. itr := list.Iter()
for { person := Person{} hasNext := itr.NextWith(&person)) if !hasNext { break } ... }
Index ¶
Constants ¶
View Source
const (
Extension = ".fb"
)
File extension.
Variables ¶
View Source
var WorkingDir = "/tmp"
Working Directory.
Functions ¶
This section is empty.
Types ¶
type EmptyIterator ¶
type EmptyIterator struct { }
Empty.
func (*EmptyIterator) NextWith ¶
func (*EmptyIterator) NextWith(object interface{}) bool
Next object.
type Iterator ¶
type Iterator interface { // Length. Len() int // Next object. Next() (interface{}, bool) // Next object. NextWith(object interface{}) bool // Close the iterator. Close() }
Iterator.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader.
Click to show internal directories.
Click to hide internal directories.