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.
type AppendableLookupFileReadAll ¶ added in v0.0.22
type AppendableLookupFileReadAll interface {
AppendableLookupFile
ReadAll() ([]byte, error)
}
AppendableLookupFileReadAll adds the ability to read the whole file
func NewAppendOptimizedFile ¶
func NewAppendOptimizedFile(file *os.File) (AppendableLookupFileReadAll, 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) ReadAll ¶ added in v0.0.22
func (fws *FileWithSize) ReadAll() ([]byte, 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 MmapReadOnly ¶ added in v0.0.24
type MmapReadOnly struct {
// contains filtered or unexported fields
}
func NewMmapReadOnly ¶ added in v0.0.24
func NewMmapReadOnly(f *os.File) (*MmapReadOnly, error)
func (*MmapReadOnly) Close ¶ added in v0.0.24
func (m *MmapReadOnly) Close() error
func (*MmapReadOnly) ReadAll ¶ added in v0.0.24
func (m *MmapReadOnly) ReadAll() ([]byte, error)
func (*MmapReadOnly) ReadAt ¶ added in v0.0.24
func (m *MmapReadOnly) ReadAt(p []byte, off int64) (n int, err error)
func (*MmapReadOnly) Size ¶ added in v0.0.24
func (m *MmapReadOnly) Size() int64
func (*MmapReadOnly) Sync ¶ added in v0.0.24
func (m *MmapReadOnly) Sync() error
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