MCPcopy Create free account
hub / github.com/jetkvm/kvm / nativeProxyClientExec

Function nativeProxyClientExec

internal/native/proxy.go:513–522  ·  view source on GitHub ↗
(p *NativeProxy, fn func(*GRPCClient) (V, error))

Source from the content-addressed store, hash-verified

511}
512
513func nativeProxyClientExec[K comparable, V string | bool | float64 | int](p *NativeProxy, fn func(*GRPCClient) (V, error)) (V, error) {
514 p.clientMu.RLock()
515 defer p.clientMu.RUnlock()
516
517 if p.client == nil {
518 return zeroValue[V](), fmt.Errorf("gRPC client not initialized")
519 }
520
521 return fn(p.client)
522}
523
524func nativeProxyClientExecWithoutArgument(p *NativeProxy, fn func(*GRPCClient) error) error {
525 p.clientMu.RLock()

Callers

nothing calls this directly

Calls 3

ErrorfMethod · 0.80
RLockMethod · 0.45
RUnlockMethod · 0.45

Tested by

no test coverage detected