Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendableLookupFile ¶
type AppendableLookupFile interface { LookupFile }
AppendableLookupFile is a LookupFile that may be optimized for the following scenario. The file typically grows by aggressive appending, one element at a time.
func NewAppendOptimizedFile ¶
func NewAppendOptimizedFile(file *os.File) (AppendableLookupFile, error)
type FileWithSize ¶ added in v0.0.7
type FileWithSize struct {
// contains filtered or unexported fields
}
func NewFileWithSize ¶ added in v0.0.7
func NewFileWithSize(file *os.File) *FileWithSize
func (*FileWithSize) Close ¶ added in v0.0.7
func (fws *FileWithSize) Close() error
func (*FileWithSize) ReadAt ¶ added in v0.0.7
func (fws *FileWithSize) ReadAt(b []byte, off int64) (int, error)
func (*FileWithSize) Size ¶ added in v0.0.7
func (fws *FileWithSize) Size() int64
func (*FileWithSize) Sync ¶ added in v0.0.7
func (fws *FileWithSize) Sync() error
type LookupFile ¶
LookupFile is a file-like array-like object. The file has array elements each a fixed number of bytes. Elements are written or read one at a time. By referring to io interfaces, we can arrange for os.File to be a naive non-optimized implementation.
type LookupFileWithSize ¶
type LookupFileWithSize interface { LookupFile Size() int64 }
type SparseLookupFile ¶
type SparseLookupFile interface { LookupFile }
SparseLookupFile is a LookupFile that may be optimized for the following scenario. The file is fixed size, and starts life full of zeros. Elements are written or read one at a time.
func NewFixedSizeMemFile ¶
func NewFixedSizeMemFile(filename string, perm os.FileMode) (SparseLookupFile, error)
NewFixedSizeMemFile Opens the file and keeps a copy in memory