MCPcopy Create free account

hub / github.com/anthdm/ggcache / functions

Functions42 in github.com/anthdm/ggcache

↓ 9 callersMethodSet
Set adds the value associated with the specified key to the cache with the specified expiration time. If the duration is zero, the cache is held indef
cache.go:18
↓ 6 callersMethodBytes
()
example/proto/protocol.go:102
↓ 6 callersMethodHas
Has checks whether the specified key exists in the cache.
cache.go:21
↓ 6 callersFunctionNew
New creates and returns a new instance of the Cache with initialized internal data. The Cache is an in-memory cache implementation using a sync.RWMute
cache.go:42
↓ 5 callersMethodGet
Get returns the value associated with the specified key. If the key is not found or an error occurs, an error object is returned.
cache.go:14
↓ 4 callersFunctionParseCommand
(r io.Reader)
example/proto/protocol.go:134
↓ 3 callersMethodDelete
Delete removes the specified key from the cache. If the key is not found, an error object is returned.
cache.go:25
↓ 2 callersMethodBytes
()
example/proto/protocol.go:46
↓ 2 callersMethodBytes
()
example/proto/protocol.go:58
↓ 2 callersMethodBytes
()
example/proto/protocol.go:123
↓ 2 callersMethodClose
()
example/client/client.go:81
↓ 2 callersMethodString
()
example/proto/protocol.go:12
↓ 2 callersMethodhandleConn
(conn net.Conn)
example/server.go:82
↓ 1 callersFunctionNew
(endpoint string, _ Options)
example/client/client.go:23
↓ 1 callersFunctionNewFromConn
(conn net.Conn)
example/client/client.go:17
↓ 1 callersFunctionNewServer
(opts ServerOpts, c ggcache.Cacher)
example/server.go:31
↓ 1 callersFunctionParseGetResponse
(r io.Reader)
example/proto/protocol.go:75
↓ 1 callersFunctionParseSetResponse
(r io.Reader)
example/proto/protocol.go:69
↓ 1 callersFunctionSendStuff
()
example/main.go:38
↓ 1 callersMethodStart
()
example/server.go:39
↓ 1 callersMethoddialLeader
()
example/server.go:65
↓ 1 callersMethodhandleCommand
(conn net.Conn, cmd any)
example/server.go:104
↓ 1 callersMethodhandleGetCommand
(conn net.Conn, cmd *proto.CommandGet)
example/server.go:123
↓ 1 callersMethodhandleJoinCommand
(conn net.Conn, _ *proto.CommandJoin)
example/server.go:115
↓ 1 callersMethodhandleSetCommand
(conn net.Conn, cmd *proto.CommandSet)
example/server.go:141
↓ 1 callersFunctionparseGetCommand
(r io.Reader)
example/proto/protocol.go:172
↓ 1 callersFunctionparseSetCommand
(r io.Reader)
example/proto/protocol.go:152
FunctionBenchmarkParseCommand
(b *testing.B)
example/proto/protocol_test.go:34
MethodDelete
Delete removes the specified key from the cache. It acquires a write lock to ensure concurrent safety during deletion. The method returns nil, indicat
cache.go:119
MethodGet
Get retrieves the value associated with the specified key from the cache. It acquires a read lock to ensure concurrent safety during retrieval. If the
cache.go:52
MethodGet
(_ context.Context, key []byte)
example/client/client.go:34
MethodHas
Has checks if the specified key exists in the cache. It acquires a read lock to ensure concurrent safety during the lookup. The method returns true if
cache.go:104
MethodSet
Set adds or updates the cache with the specified key-value pair. It acquires a write lock to ensure concurrent safety during insertion. If the time-to
cache.go:76
MethodSet
(_ context.Context, key []byte, value []byte, ttl int)
example/client/client.go:58
FunctionTestCacheIntegration
TestCacheIntegration tests the Cache integration by combining multiple operations.
cache_test.go:101
FunctionTestCache_Delete
TestCache_Delete tests the Delete method of the Cache.
cache_test.go:75
FunctionTestCache_Get
TestCache_Get tests the Get method of the Cache.
cache_test.go:9
FunctionTestCache_Has
TestCache_Has tests the Has method of the Cache.
cache_test.go:56
FunctionTestCache_Set
TestCache_Set tests the Set method of the Cache.
cache_test.go:34
FunctionTestParseGetCommand
(t *testing.T)
example/proto/protocol_test.go:10
FunctionTestParseSetCommand
(t *testing.T)
example/proto/protocol_test.go:21
Functionmain
()
example/main.go:14