MCPcopy
hub / github.com/containerd/containerd / NewClient

Function NewClient

core/sandbox/bridge.go:30–39  ·  view source on GitHub ↗

NewClient returns a new sandbox client that handles both GRPC and TTRPC clients.

(client any)

Source from the content-addressed store, hash-verified

28
29// NewClient returns a new sandbox client that handles both GRPC and TTRPC clients.
30func NewClient(client any) (api.TTRPCSandboxService, error) {
31 switch c := client.(type) {
32 case *ttrpc.Client:
33 return api.NewTTRPCSandboxClient(c), nil
34 case grpc.ClientConnInterface:
35 return &grpcBridge{api.NewSandboxClient(c)}, nil
36 default:
37 return nil, fmt.Errorf("unsupported client type %T", client)
38 }
39}
40
41type grpcBridge struct {
42 client api.SandboxClient

Callers 3

CreateMethod · 0.92
StartMethod · 0.92
getSandboxMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…