MCPcopy Create free account

hub / github.com/peterbourgon/diskv / functions

Functions131 in github.com/peterbourgon/diskv

↓ 40 callersMethodWrite
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 callersMethodEraseAll
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 callersFunctionNew
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 callersMethodisCached
(key string)
basic_test.go:25
↓ 18 callersMethodRead
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 callersMethodClose
()
diskv.go:729
↓ 10 callersMethodKeys
(from string, n int)
index.go:15
↓ 10 callersMethodRead
(p []byte)
basic_test.go:261
↓ 8 callersMethodReadStream
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 callersFunctionbenchRead
(b *testing.B, size, cachesz int)
speed_test.go:42
↓ 8 callersFunctionbenchWrite
(b *testing.B, size int, withIndex bool)
speed_test.go:63
↓ 7 callersFunctioncmpBytes
(a, b []byte)
basic_test.go:13
↓ 7 callersFunctionrandStringBytes
(n int)
basic_test.go:343
↓ 7 callersMethodtransform
(key string)
diskv.go:164
↓ 6 callersMethodcompleteFilename
completeFilename returns the absolute path to the file for the given key.
diskv.go:626
↓ 5 callersMethodWriteStream
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 callersMethodWriteString
WriteString writes a string key-value pair to disk
diskv.go:160
↓ 4 callersMethodErase
Erase synchronously erases the given key from the disk and the cache.
diskv.go:484
↓ 4 callersMethodHas
Has returns true if the given key exists.
diskv.go:531
↓ 4 callersMethodbustCacheWithLock
(key string)
diskv.go:658
↓ 4 callersFunctioncheckKeys
(t *testing.T, c <-chan string, want map[string]string)
keys_test.go:140
↓ 4 callersFunctiontestCompressionWith
(t *testing.T, c Compression, name string)
compression_test.go:16
↓ 3 callersMethodKeysPrefix
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 callersFunctionNewGzipCompressionLevel
NewGzipCompressionLevel returns a Gzip-based Compression with the given level.
compression.go:27
↓ 3 callersMethodReadString
ReadString reads the key and returns a string value In case of error, an empty string is returned
diskv.go:349
↓ 3 callersFunctionfilterPrefix
(in map[string]string, prefix string)
keys_test.go:170
↓ 3 callersFunctionflattenKeys
(m map[string]string)
keys_test.go:223
↓ 3 callersMethodpathFor
pathFor returns the absolute path for location on the filesystem where the data for the given key will be stored.
diskv.go:615
↓ 3 callersMethoduncacheWithLock
(key string, sz uint64)
diskv.go:664
↓ 2 callersMethodDelete
(key string)
index.go:14
↓ 2 callersMethodImport
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 callersMethodReader
(src io.Reader)
compression.go:18
↓ 2 callersFunctionblockTransform
(blockSize int)
keys_test.go:156
↓ 2 callersMethodensurePathWithLock
ensurePathWithLock is a helper function that generates all necessary directories on the filesystem for the given key.
diskv.go:621
↓ 2 callersFunctiongenKeys
()
speed_test.go:28
↓ 2 callersFunctiongenValue
(size int)
speed_test.go:16
↓ 2 callersMethodisIndexed
(key string)
index_test.go:24
↓ 2 callersFunctionshuffle
(keys []string)
speed_test.go:9
↓ 2 callersMethodwriteStreamWithLock
writeStream does no input validation checking.
diskv.go:228
↓ 1 callersMethodInitialize
(less LessFunction, keys <-chan string)
index.go:12
↓ 1 callersMethodInsert
(key string)
index.go:13
↓ 1 callersMethodKeys
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 callersFunctionNewGzipCompression
NewGzipCompression returns a Gzip-based Compression.
compression.go:22
↓ 1 callersFunctionNewZlibCompression
NewZlibCompression returns a Zlib-based Compression.
compression.go:35
↓ 1 callersFunctionNewZlibCompressionLevel
NewZlibCompressionLevel returns a Zlib-based Compression with the given level.
compression.go:40
↓ 1 callersFunctionNewZlibCompressionLevelDict
NewZlibCompressionLevelDict returns a Zlib-based Compression with the given level, based on the given dictionary.
compression.go:46
↓ 1 callersMethodWriter
(dst io.Writer)
compression.go:17
↓ 1 callersMethodcacheWithLock
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 callersMethodcacheWithoutLock
cacheWithoutLock acquires the store's (write) mutex and calls cacheWithLock.
diskv.go:652
↓ 1 callersFunctioncmpStrings
(a, b []string)
index_test.go:12
↓ 1 callersFunctionconvertToAdvancedTransform
convertToAdvancedTransform takes a classic Transform function and converts it to the new AdvancedTransform
diskv.go:146
↓ 1 callersMethodcreateKeyFileWithLock
createKeyFileWithLock either creates the key file directly, or creates a temporary file in TempDir if it is set.
diskv.go:201
↓ 1 callersMethodensureCacheSpaceWithLock
ensureCacheSpaceWithLock deletes entries from the cache in arbitrary order until the cache has at least valueSize bytes available.
diskv.go:700
↓ 1 callersMethodload
(keys []string, val []byte)
speed_test.go:36
↓ 1 callersFunctionmd5sum
(s string)
examples/content-addressable-store/cas.go:59
↓ 1 callersFunctionnewSiphon
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 callersMethodpruneDirsWithLock
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 callersMethodreadWithRLock
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 callersFunctionrebuild
rebuildIndex does the work of regenerating the index with the given keys.
index.go:109
↓ 1 callersMethodwalker
walker returns a function which satisfies the filepath.WalkFunc interface. It sends every non-directory file entry down the channel c.
diskv.go:581
FunctionAdvancedTransformExample
(key string)
examples/advanced-transform/advanced-transform.go:10
FunctionBenchmarkRead_10KB_NoCache
(b *testing.B)
speed_test.go:133
FunctionBenchmarkRead_10KB_WithCache
(b *testing.B)
speed_test.go:149
FunctionBenchmarkRead__1KB_NoCache
(b *testing.B)
speed_test.go:125
FunctionBenchmarkRead__1KB_WithCache
(b *testing.B)
speed_test.go:141
FunctionBenchmarkRead__32B_NoCache
(b *testing.B)
speed_test.go:121
FunctionBenchmarkRead__32B_WithCache
(b *testing.B)
speed_test.go:137
FunctionBenchmarkRead__4KB_NoCache
(b *testing.B)
speed_test.go:129
FunctionBenchmarkRead__4KB_WithCache
(b *testing.B)
speed_test.go:145
FunctionBenchmarkWrite_10KB_NoIndex
(b *testing.B)
speed_test.go:101
FunctionBenchmarkWrite_10KB_WithIndex
(b *testing.B)
speed_test.go:117
FunctionBenchmarkWrite__1KB_NoIndex
(b *testing.B)
speed_test.go:93
FunctionBenchmarkWrite__1KB_WithIndex
(b *testing.B)
speed_test.go:109
FunctionBenchmarkWrite__32B_NoIndex
(b *testing.B)
speed_test.go:89
FunctionBenchmarkWrite__32B_WithIndex
(b *testing.B)
speed_test.go:105
FunctionBenchmarkWrite__4KB_NoIndex
(b *testing.B)
speed_test.go:97
FunctionBenchmarkWrite__4KB_WithIndex
(b *testing.B)
speed_test.go:113
MethodDelete
Delete removes the given key (only) from the BTree tree.
index.go:60
MethodInitialize
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
MethodInsert
Insert inserts the given key (only) into the BTree tree.
index.go:50
FunctionInverseTransformExample
If you provide an AdvancedTransform, you must also provide its inverse:
examples/advanced-transform/advanced-transform.go:22
MethodKeys
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
MethodLess
Less satisfies the BTree.Less interface using the btreeString's LessFunction.
index.go:29
MethodRead
(p []byte)
diskv.go:433
MethodRead
Read implements the io.Reader interface for siphon.
diskv.go:465
MethodRead
(p []byte)
basic_test.go:309
MethodReader
(src io.Reader)
compression.go:62
FunctionTestAtomicWrite
(t *testing.T)
basic_test.go:313
FunctionTestBadKeys
(t *testing.T)
index_test.go:146
FunctionTestBasicStreamCaching
(t *testing.T)
stream_test.go:9
FunctionTestFilterPrefix
(t *testing.T)
keys_test.go:180
FunctionTestGzipBestCompression
(t *testing.T)
compression_test.go:62
FunctionTestGzipBestSpeed
(t *testing.T)
compression_test.go:66
FunctionTestGzipDefault
(t *testing.T)
compression_test.go:58
FunctionTestHas
(t *testing.T)
basic_test.go:221
FunctionTestHybridStore
(t *testing.T)
basic_test.go:351
FunctionTestImportCopy
(t *testing.T)
import_test.go:52
FunctionTestImportMove
(t *testing.T)
import_test.go:13
FunctionTestIndexKeysEmptyFrom
(t *testing.T)
index_test.go:126
FunctionTestIndexLoad
(t *testing.T)
index_test.go:67
next →1–100 of 131, ranked by callers