Documentation ¶
Index ¶
- Constants
- Variables
- func CopyTempThreshold(threshold int64) datafileOptFunc
- func FileMode(mode os.FileMode) datafileOptFunc
- func IsDatafile(fileName string) bool
- func Open(id FileID, dir string, funcs ...datafileOptFunc) (*defaultDatafile, error)
- func OpenReadonly(id FileID, dir string, funcs ...datafileOptFunc) (*defaultDatafile, error)
- func RuntimeContext(ctx runtime.Context) datafileOptFunc
- func TempDir(dir string) datafileOptFunc
- type Datafile
- type EOFType
- type Entry
- type FileID
- type Header
Constants ¶
View Source
const (
FileIDByteSize int = 8 + 8
)
Variables ¶
View Source
var ( // ErrChecksumFailed is the error returned if a key/value retrieved does // not match its CRC checksum ErrChecksumFailed = errors.New("error: checksum failed") )
Functions ¶
func CopyTempThreshold ¶
func CopyTempThreshold(threshold int64) datafileOptFunc
func IsDatafile ¶ added in v1.4.0
func OpenReadonly ¶
func RuntimeContext ¶
Types ¶
type Datafile ¶
type Datafile interface { FileID() FileID Name() string Close() error Sync() error Size() int64 Read() (*Entry, error) ReadAt(index, size int64) (*Entry, error) ReadAtHeader(index int64) (*Header, EOFType, error) Write(key []byte, value io.Reader, expiry time.Time) (int64, int64, error) }
Datafile is an interface that represents a readable and writeable datafile
type Entry ¶
type Entry struct { Key []byte Value io.Reader TotalSize int64 ValueSize int64 Checksum uint32 Expiry time.Time // contains filtered or unexported fields }
Entry represents a key/value in the database
type FileID ¶
func CreateFileID ¶ added in v1.4.0
func GrepFileIds ¶ added in v1.4.0
func GrepFileIdsFromDatafilePath ¶ added in v1.4.0
func NextFileID ¶ added in v1.4.0
func NextFileID() FileID
Click to show internal directories.
Click to hide internal directories.