MCPcopy
hub / github.com/dropbox/godropbox / Storage

Interface Storage

caching/interface.go:7–29  ·  view source on GitHub ↗

A generic key value storage interface. The storage may be persistent (e.g., a database) or volatile (e.g., cache). All Storage implementations must be thread safe.

Source from the content-addressed store, hash-verified

5// (e.g., a database) or volatile (e.g., cache). All Storage implementations
6// must be thread safe.
7type Storage interface {
8 // This retrieves a single value from the storage.
9 Get(key interface{}) (interface{}, error)
10
11 // This retrieves multiple values from the storage. The items are returned
12 // in the same order as the input keys.
13 GetMulti(keys ...interface{}) ([]interface{}, error)
14
15 // This stores a single item into the storage.
16 Set(item interface{}) error
17
18 // This stores multiple items into the storage.
19 SetMulti(items ...interface{}) error
20
21 // This removes a single item from the storage.
22 Delete(key interface{}) error
23
24 // This removes multiple items from the storage.
25 DeleteMulti(keys ...interface{}) error
26
27 // This wipes all items from the storage.
28 Flush() error
29}
30
31type ToStringFunc (func(key interface{}) string)

Callers 47

TestGetMethod · 0.65
TestSetMethod · 0.65
GetMethod · 0.65
GetMethod · 0.65
TestGetMethod · 0.65
TestSetMethod · 0.65
TestGetCacheHitMethod · 0.65
TestGetCacheMissMethod · 0.65
TestGetMultiMethod · 0.65
TestSetMultiMethod · 0.65
TestDeleteMethod · 0.65
TestDeleteMultiMethod · 0.65

Implementers 7

MockClientmemcache/mock_client.go
RawBinaryClientmemcache/raw_binary_client.go
ShardedClientmemcache/sharded_client.go
RawAsciiClientmemcache/raw_ascii_client.go
RateLimitedStoragecaching/rate_limited_storage.go
CacheOnStoragecaching/cache_on_storage.go
GenericStoragecaching/generic_storage.go

Calls

no outgoing calls

Tested by

no test coverage detected