Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthdm/ggcache
/ functions
Functions
42 in github.com/anthdm/ggcache
⨍
Functions
42
◇
Types & classes
13
↓ 9 callers
Method
Set
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 callers
Method
Bytes
()
example/proto/protocol.go:102
↓ 6 callers
Method
Has
Has checks whether the specified key exists in the cache.
cache.go:21
↓ 6 callers
Function
New
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 callers
Method
Get
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 callers
Function
ParseCommand
(r io.Reader)
example/proto/protocol.go:134
↓ 3 callers
Method
Delete
Delete removes the specified key from the cache. If the key is not found, an error object is returned.
cache.go:25
↓ 2 callers
Method
Bytes
()
example/proto/protocol.go:46
↓ 2 callers
Method
Bytes
()
example/proto/protocol.go:58
↓ 2 callers
Method
Bytes
()
example/proto/protocol.go:123
↓ 2 callers
Method
Close
()
example/client/client.go:81
↓ 2 callers
Method
String
()
example/proto/protocol.go:12
↓ 2 callers
Method
handleConn
(conn net.Conn)
example/server.go:82
↓ 1 callers
Function
New
(endpoint string, _ Options)
example/client/client.go:23
↓ 1 callers
Function
NewFromConn
(conn net.Conn)
example/client/client.go:17
↓ 1 callers
Function
NewServer
(opts ServerOpts, c ggcache.Cacher)
example/server.go:31
↓ 1 callers
Function
ParseGetResponse
(r io.Reader)
example/proto/protocol.go:75
↓ 1 callers
Function
ParseSetResponse
(r io.Reader)
example/proto/protocol.go:69
↓ 1 callers
Function
SendStuff
()
example/main.go:38
↓ 1 callers
Method
Start
()
example/server.go:39
↓ 1 callers
Method
dialLeader
()
example/server.go:65
↓ 1 callers
Method
handleCommand
(conn net.Conn, cmd any)
example/server.go:104
↓ 1 callers
Method
handleGetCommand
(conn net.Conn, cmd *proto.CommandGet)
example/server.go:123
↓ 1 callers
Method
handleJoinCommand
(conn net.Conn, _ *proto.CommandJoin)
example/server.go:115
↓ 1 callers
Method
handleSetCommand
(conn net.Conn, cmd *proto.CommandSet)
example/server.go:141
↓ 1 callers
Function
parseGetCommand
(r io.Reader)
example/proto/protocol.go:172
↓ 1 callers
Function
parseSetCommand
(r io.Reader)
example/proto/protocol.go:152
Function
BenchmarkParseCommand
(b *testing.B)
example/proto/protocol_test.go:34
Method
Delete
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
Method
Get
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
Method
Get
(_ context.Context, key []byte)
example/client/client.go:34
Method
Has
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
Method
Set
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
Method
Set
(_ context.Context, key []byte, value []byte, ttl int)
example/client/client.go:58
Function
TestCacheIntegration
TestCacheIntegration tests the Cache integration by combining multiple operations.
cache_test.go:101
Function
TestCache_Delete
TestCache_Delete tests the Delete method of the Cache.
cache_test.go:75
Function
TestCache_Get
TestCache_Get tests the Get method of the Cache.
cache_test.go:9
Function
TestCache_Has
TestCache_Has tests the Has method of the Cache.
cache_test.go:56
Function
TestCache_Set
TestCache_Set tests the Set method of the Cache.
cache_test.go:34
Function
TestParseGetCommand
(t *testing.T)
example/proto/protocol_test.go:10
Function
TestParseSetCommand
(t *testing.T)
example/proto/protocol_test.go:21
Function
main
()
example/main.go:14