MCPcopy Index your code
hub / github.com/docker/docker-agent / NewRemoteRuntime

Function NewRemoteRuntime

pkg/runtime/remote_runtime.go:73–89  ·  view source on GitHub ↗

NewRemoteRuntime creates a new remote runtime that implements the Runtime interface. It accepts any client that implements the RemoteClient interface.

(client RemoteClient, opts ...RemoteRuntimeOption)

Source from the content-addressed store, hash-verified

71// NewRemoteRuntime creates a new remote runtime that implements the Runtime interface.
72// It accepts any client that implements the RemoteClient interface.
73func NewRemoteRuntime(client RemoteClient, opts ...RemoteRuntimeOption) (*RemoteRuntime, error) {
74 if client == nil {
75 return nil, errors.New("client cannot be nil")
76 }
77
78 r := &RemoteRuntime{
79 client: client,
80 agentFilename: "agent.yaml",
81 team: team.New(),
82 }
83
84 for _, opt := range opts {
85 opt(r)
86 }
87
88 return r, nil
89}
90
91// resolvedAgent returns the active agent's name and config from the remote
92// team. When no specific agent has been selected, both come from the team's

Calls 2

NewFunction · 0.92
NewMethod · 0.45