Skip to content

Commit b83d04f

Browse files
committed
Add variable names to runtime's interface definitions
To ease code readability Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent 993b863 commit b83d04f

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

runtime/runtime.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ type PlatformRuntime interface {
6363
// ID of the runtime
6464
ID() string
6565
// Create creates a task with the provided id and options.
66-
Create(ctx context.Context, id string, opts CreateOpts) (Task, error)
66+
Create(ctx context.Context, taskID string, opts CreateOpts) (Task, error)
6767
// Get returns a task.
68-
Get(context.Context, string) (Task, error)
68+
Get(ctx context.Context, taskID string) (Task, error)
6969
// Tasks returns all the current tasks for the runtime.
7070
// Any container runs at most one task at a time.
71-
Tasks(context.Context, bool) ([]Task, error)
71+
Tasks(ctx context.Context, all bool) ([]Task, error)
7272
// Add adds a task into runtime.
73-
Add(context.Context, Task) error
73+
Add(ctx context.Context, task Task) error
7474
// Delete remove a task.
75-
Delete(context.Context, string)
75+
Delete(ctx context.Context, taskID string)
7676
}

runtime/task.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ type Process interface {
3636
// ID of the process
3737
ID() string
3838
// State returns the process state
39-
State(context.Context) (State, error)
39+
State(ctx context.Context) (State, error)
4040
// Kill signals a container
41-
Kill(context.Context, uint32, bool) error
42-
// Pty resizes the processes pty/console
43-
ResizePty(context.Context, ConsoleSize) error
44-
// CloseStdin closes the processes stdin
45-
CloseIO(context.Context) error
41+
Kill(ctx context.Context, signal uint32, all bool) error
42+
// ResizePty resizes the processes pty/console
43+
ResizePty(ctx context.Context, size ConsoleSize) error
44+
// CloseIO closes the processes IO
45+
CloseIO(ctx context.Context) error
4646
// Start the container's user defined process
47-
Start(context.Context) error
47+
Start(ctx context.Context) error
4848
// Wait for the process to exit
49-
Wait(context.Context) (*Exit, error)
49+
Wait(ctx context.Context) (*Exit, error)
5050
// Delete deletes the process
51-
Delete(context.Context) (*Exit, error)
51+
Delete(ctx context.Context) (*Exit, error)
5252
}
5353

5454
// Task is the runtime object for an executing container
@@ -60,21 +60,21 @@ type Task interface {
6060
// Namespace that the task exists in
6161
Namespace() string
6262
// Pause pauses the container process
63-
Pause(context.Context) error
63+
Pause(ctx context.Context) error
6464
// Resume unpauses the container process
65-
Resume(context.Context) error
65+
Resume(ctx context.Context) error
6666
// Exec adds a process into the container
67-
Exec(context.Context, string, ExecOpts) (Process, error)
67+
Exec(ctx context.Context, id string, opts ExecOpts) (Process, error)
6868
// Pids returns all pids
69-
Pids(context.Context) ([]ProcessInfo, error)
69+
Pids(ctx context.Context) ([]ProcessInfo, error)
7070
// Checkpoint checkpoints a container to an image with live system data
71-
Checkpoint(context.Context, string, *types.Any) error
71+
Checkpoint(ctx context.Context, path string, opts *types.Any) error
7272
// Update sets the provided resources to a running task
73-
Update(context.Context, *types.Any, map[string]string) error
73+
Update(ctx context.Context, resources *types.Any, annotations map[string]string) error
7474
// Process returns a process within the task for the provided id
75-
Process(context.Context, string) (Process, error)
75+
Process(ctx context.Context, id string) (Process, error)
7676
// Stats returns runtime specific metrics for a task
77-
Stats(context.Context) (*types.Any, error)
77+
Stats(ctx context.Context) (*types.Any, error)
7878
}
7979

8080
// ExecOpts provides additional options for additional processes running in a task

0 commit comments

Comments
 (0)