MCPcopy
hub / github.com/lima-vm/lima / getClient

Method getClient

pkg/hostagent/hostagent.go:851–855  ·  view source on GitHub ↗

getClient returns the current guest agent client under the clientMu lock, so callers observe a consistent (non-mid-transition) snapshot.

()

Source from the content-addressed store, hash-verified

849// getClient returns the current guest agent client under the clientMu lock,
850// so callers observe a consistent (non-mid-transition) snapshot.
851func (a *HostAgent) getClient() *guestagentclient.GuestAgentClient {
852 a.clientMu.Lock()
853 defer a.clientMu.Unlock()
854 return a.client
855}
856
857func (a *HostAgent) getOrCreateClient(ctx context.Context) (*guestagentclient.GuestAgentClient, error) {
858 a.clientMu.Lock()

Callers 1

watchGuestAgentEventsMethod · 0.95

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected