MCPcopy
hub / github.com/docker/compose / ExecCreate

Method ExecCreate

pkg/dryrun/dryrunclient.go:285–296  ·  pkg/dryrun/dryrunclient.go::DryRunClient.ExecCreate
(ctx context.Context, container string, config client.ExecCreateOptions)

Source from the content-addressed store, hash-verified

283}
284
285func (d *DryRunClient) ExecCreate(ctx context.Context, container string, config client.ExecCreateOptions) (client.ExecCreateResult, error) {
286 b := make([]byte, 32)
287 _, _ = rand.Read(b)
288 id := fmt.Sprintf("%x", b)
289 d.execs.Store(id, execDetails{
290 container: container,
291 command: config.Cmd,
292 })
293 return client.ExecCreateResult{
294 ID: id,
295 }, nil
296}
297
298func (d *DryRunClient) ExecStart(ctx context.Context, execID string, config client.ExecStartOptions) (client.ExecStartResult, error) {
299 _, ok := d.execs.LoadAndDelete(execID)

Callers 3

TestRunHook_ConsoleSizeFunction · 0.45
ExecMethod · 0.45
runHookMethod · 0.45

Calls 1

ReadMethod · 0.45

Tested by 1

TestRunHook_ConsoleSizeFunction · 0.36