MCPcopy Create free account
hub / github.com/astercloud/aster / get

Method get

pkg/tools/bridge/http_server.go:37–52  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

35}
36
37func (c *schemaCache) get(key string) (any, bool) {
38 c.mu.RLock()
39 defer c.mu.RUnlock()
40
41 entry, ok := c.entries[key]
42 if !ok {
43 return nil, false
44 }
45
46 // 检查是否过期
47 if time.Since(entry.timestamp) > c.ttl {
48 return nil, false
49 }
50
51 return entry.data, true
52}
53
54func (c *schemaCache) set(key string, value any) {
55 c.mu.Lock()

Callers 1

handleToolSchemaMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected