Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/peterbourgon/diskv
/ functions
Functions
131 in github.com/peterbourgon/diskv
⨍
Functions
131
◇
Types & classes
17
↓ 40 callers
Method
Write
Write synchronously writes the key-value pair to disk, making it immediately available for reads. Write relies on the filesystem to perform an eventua
diskv.go:155
↓ 33 callers
Method
EraseAll
EraseAll will delete all of the data from the store, both in the cache and on the disk. Note that EraseAll doesn't distinguish diskv-related data from
diskv.go:519
↓ 32 callers
Function
New
New returns an initialized Diskv structure, ready to use. If the path identified by baseDir already contains data, it will be accessible, but not yet
diskv.go:104
↓ 19 callers
Method
isCached
(key string)
basic_test.go:25
↓ 18 callers
Method
Read
Read reads the key and returns the value. If the key is available in the cache, Read won't touch the disk. If the key is not in the cache, Read will h
diskv.go:338
↓ 15 callers
Method
Close
()
diskv.go:729
↓ 10 callers
Method
Keys
(from string, n int)
index.go:15
↓ 10 callers
Method
Read
(p []byte)
basic_test.go:261
↓ 8 callers
Method
ReadStream
ReadStream reads the key and returns the value (data) as an io.ReadCloser. If the value is cached from a previous read, and direct is false, ReadStrea
diskv.go:364
↓ 8 callers
Function
benchRead
(b *testing.B, size, cachesz int)
speed_test.go:42
↓ 8 callers
Function
benchWrite
(b *testing.B, size int, withIndex bool)
speed_test.go:63
↓ 7 callers
Function
cmpBytes
(a, b []byte)
basic_test.go:13
↓ 7 callers
Function
randStringBytes
(n int)
basic_test.go:343
↓ 7 callers
Method
transform
(key string)
diskv.go:164
↓ 6 callers
Method
completeFilename
completeFilename returns the absolute path to the file for the given key.
diskv.go:626
↓ 5 callers
Method
WriteStream
WriteStream writes the data represented by the io.Reader to the disk, under the provided key. If sync is true, WriteStream performs an explicit sync o
diskv.go:175
↓ 5 callers
Method
WriteString
WriteString writes a string key-value pair to disk
diskv.go:160
↓ 4 callers
Method
Erase
Erase synchronously erases the given key from the disk and the cache.
diskv.go:484
↓ 4 callers
Method
Has
Has returns true if the given key exists.
diskv.go:531
↓ 4 callers
Method
bustCacheWithLock
(key string)
diskv.go:658
↓ 4 callers
Function
checkKeys
(t *testing.T, c <-chan string, want map[string]string)
keys_test.go:140
↓ 4 callers
Function
testCompressionWith
(t *testing.T, c Compression, name string)
compression_test.go:16
↓ 3 callers
Method
KeysPrefix
KeysPrefix returns a channel that will yield every key accessible by the store with the given prefix, in undefined order. If a cancel channel is provi
diskv.go:563
↓ 3 callers
Function
NewGzipCompressionLevel
NewGzipCompressionLevel returns a Gzip-based Compression with the given level.
compression.go:27
↓ 3 callers
Method
ReadString
ReadString reads the key and returns a string value In case of error, an empty string is returned
diskv.go:349
↓ 3 callers
Function
filterPrefix
(in map[string]string, prefix string)
keys_test.go:170
↓ 3 callers
Function
flattenKeys
(m map[string]string)
keys_test.go:223
↓ 3 callers
Method
pathFor
pathFor returns the absolute path for location on the filesystem where the data for the given key will be stored.
diskv.go:615
↓ 3 callers
Method
uncacheWithLock
(key string, sz uint64)
diskv.go:664
↓ 2 callers
Method
Delete
(key string)
index.go:14
↓ 2 callers
Method
Import
Import imports the source file into diskv under the destination key. If the destination key already exists, it's overwritten. If move is true, the sou
diskv.go:292
↓ 2 callers
Method
Reader
(src io.Reader)
compression.go:18
↓ 2 callers
Function
blockTransform
(blockSize int)
keys_test.go:156
↓ 2 callers
Method
ensurePathWithLock
ensurePathWithLock is a helper function that generates all necessary directories on the filesystem for the given key.
diskv.go:621
↓ 2 callers
Function
genKeys
()
speed_test.go:28
↓ 2 callers
Function
genValue
(size int)
speed_test.go:16
↓ 2 callers
Method
isIndexed
(key string)
index_test.go:24
↓ 2 callers
Function
shuffle
(keys []string)
speed_test.go:9
↓ 2 callers
Method
writeStreamWithLock
writeStream does no input validation checking.
diskv.go:228
↓ 1 callers
Method
Initialize
(less LessFunction, keys <-chan string)
index.go:12
↓ 1 callers
Method
Insert
(key string)
index.go:13
↓ 1 callers
Method
Keys
Keys returns a channel that will yield every key accessible by the store, in undefined order. If a cancel channel is provided, closing it will termina
diskv.go:555
↓ 1 callers
Function
NewGzipCompression
NewGzipCompression returns a Gzip-based Compression.
compression.go:22
↓ 1 callers
Function
NewZlibCompression
NewZlibCompression returns a Zlib-based Compression.
compression.go:35
↓ 1 callers
Function
NewZlibCompressionLevel
NewZlibCompressionLevel returns a Zlib-based Compression with the given level.
compression.go:40
↓ 1 callers
Function
NewZlibCompressionLevelDict
NewZlibCompressionLevelDict returns a Zlib-based Compression with the given level, based on the given dictionary.
compression.go:46
↓ 1 callers
Method
Writer
(dst io.Writer)
compression.go:17
↓ 1 callers
Method
cacheWithLock
cacheWithLock attempts to cache the given key-value pair in the store's cache. It can fail if the value is larger than the cache's maximum size.
diskv.go:632
↓ 1 callers
Method
cacheWithoutLock
cacheWithoutLock acquires the store's (write) mutex and calls cacheWithLock.
diskv.go:652
↓ 1 callers
Function
cmpStrings
(a, b []string)
index_test.go:12
↓ 1 callers
Function
convertToAdvancedTransform
convertToAdvancedTransform takes a classic Transform function and converts it to the new AdvancedTransform
diskv.go:146
↓ 1 callers
Method
createKeyFileWithLock
createKeyFileWithLock either creates the key file directly, or creates a temporary file in TempDir if it is set.
diskv.go:201
↓ 1 callers
Method
ensureCacheSpaceWithLock
ensureCacheSpaceWithLock deletes entries from the cache in arbitrary order until the cache has at least valueSize bytes available.
diskv.go:700
↓ 1 callers
Method
load
(keys []string, val []byte)
speed_test.go:36
↓ 1 callers
Function
md5sum
(s string)
examples/content-addressable-store/cas.go:59
↓ 1 callers
Function
newSiphon
newSiphon constructs a siphoning reader that represents the passed file. When a successful series of reads ends in an EOF, the siphon will write the b
diskv.go:455
↓ 1 callers
Method
pruneDirsWithLock
pruneDirsWithLock deletes empty directories in the path walk leading to the key k. Typically this function is called after an Erase is made.
diskv.go:671
↓ 1 callers
Method
readWithRLock
read ignores the cache, and returns an io.ReadCloser representing the decompressed data for the given key, streamed from the disk. Clients should acqu
diskv.go:393
↓ 1 callers
Function
rebuild
rebuildIndex does the work of regenerating the index with the given keys.
index.go:109
↓ 1 callers
Method
walker
walker returns a function which satisfies the filepath.WalkFunc interface. It sends every non-directory file entry down the channel c.
diskv.go:581
Function
AdvancedTransformExample
(key string)
examples/advanced-transform/advanced-transform.go:10
Function
BenchmarkRead_10KB_NoCache
(b *testing.B)
speed_test.go:133
Function
BenchmarkRead_10KB_WithCache
(b *testing.B)
speed_test.go:149
Function
BenchmarkRead__1KB_NoCache
(b *testing.B)
speed_test.go:125
Function
BenchmarkRead__1KB_WithCache
(b *testing.B)
speed_test.go:141
Function
BenchmarkRead__32B_NoCache
(b *testing.B)
speed_test.go:121
Function
BenchmarkRead__32B_WithCache
(b *testing.B)
speed_test.go:137
Function
BenchmarkRead__4KB_NoCache
(b *testing.B)
speed_test.go:129
Function
BenchmarkRead__4KB_WithCache
(b *testing.B)
speed_test.go:145
Function
BenchmarkWrite_10KB_NoIndex
(b *testing.B)
speed_test.go:101
Function
BenchmarkWrite_10KB_WithIndex
(b *testing.B)
speed_test.go:117
Function
BenchmarkWrite__1KB_NoIndex
(b *testing.B)
speed_test.go:93
Function
BenchmarkWrite__1KB_WithIndex
(b *testing.B)
speed_test.go:109
Function
BenchmarkWrite__32B_NoIndex
(b *testing.B)
speed_test.go:89
Function
BenchmarkWrite__32B_WithIndex
(b *testing.B)
speed_test.go:105
Function
BenchmarkWrite__4KB_NoIndex
(b *testing.B)
speed_test.go:97
Function
BenchmarkWrite__4KB_WithIndex
(b *testing.B)
speed_test.go:113
Method
Delete
Delete removes the given key (only) from the BTree tree.
index.go:60
Method
Initialize
Initialize populates the BTree tree with data from the keys channel, according to the passed less function. It's destructive to the BTreeIndex.
index.go:42
Method
Insert
Insert inserts the given key (only) into the BTree tree.
index.go:50
Function
InverseTransformExample
If you provide an AdvancedTransform, you must also provide its inverse:
examples/advanced-transform/advanced-transform.go:22
Method
Keys
Keys yields a maximum of n keys in order. If the passed 'from' key is empty, Keys will return the first n keys. If the passed 'from' key is non-empty,
index.go:73
Method
Less
Less satisfies the BTree.Less interface using the btreeString's LessFunction.
index.go:29
Method
Read
(p []byte)
diskv.go:433
Method
Read
Read implements the io.Reader interface for siphon.
diskv.go:465
Method
Read
(p []byte)
basic_test.go:309
Method
Reader
(src io.Reader)
compression.go:62
Function
TestAtomicWrite
(t *testing.T)
basic_test.go:313
Function
TestBadKeys
(t *testing.T)
index_test.go:146
Function
TestBasicStreamCaching
(t *testing.T)
stream_test.go:9
Function
TestFilterPrefix
(t *testing.T)
keys_test.go:180
Function
TestGzipBestCompression
(t *testing.T)
compression_test.go:62
Function
TestGzipBestSpeed
(t *testing.T)
compression_test.go:66
Function
TestGzipDefault
(t *testing.T)
compression_test.go:58
Function
TestHas
(t *testing.T)
basic_test.go:221
Function
TestHybridStore
(t *testing.T)
basic_test.go:351
Function
TestImportCopy
(t *testing.T)
import_test.go:52
Function
TestImportMove
(t *testing.T)
import_test.go:13
Function
TestIndexKeysEmptyFrom
(t *testing.T)
index_test.go:126
Function
TestIndexLoad
(t *testing.T)
index_test.go:67
next →
1–100 of 131, ranked by callers