MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / CurrentKVClient

Function CurrentKVClient

internal/home/kv_helpers.go:20–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20func CurrentKVClient() (*Client, bool, error) {
21 client := Current()
22 if client == nil {
23 return nil, false, nil
24 }
25 if !client.Enabled() {
26 return nil, true, fmt.Errorf("home kv store unavailable: %w", ErrDisabled)
27 }
28 if !client.HeartbeatOK() {
29 return nil, true, fmt.Errorf("home kv store unavailable: %w", ErrNotConnected)
30 }
31 return client, true, nil
32}
33
34func KVGetJSONRequired(ctx context.Context, key string, out any) (bool, bool, error) {
35 client, homeMode, errClient := CurrentKVClient()

Callers 6

KVGetJSONRequiredFunction · 0.85
KVSetBytesRequiredFunction · 0.85
KVSetNXRequiredFunction · 0.85
KVDelRequiredFunction · 0.85
KVExpireRequiredFunction · 0.85

Calls 3

CurrentFunction · 0.85
EnabledMethod · 0.80
HeartbeatOKMethod · 0.65

Tested by 1