From a901091f7c536c504981423bc785fa6322bc874e Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 7 Dec 2017 12:25:27 -0500 Subject: [PATCH] Rename cio.Creation to cio.Creator Signed-off-by: Daniel Nephin --- cio/io.go | 10 +++++----- container.go | 4 ++-- container_test.go | 2 +- task.go | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cio/io.go b/cio/io.go index 8e94686bc..43476966b 100644 --- a/cio/io.go +++ b/cio/io.go @@ -33,8 +33,8 @@ type IO interface { Close() error } -// Creation creates new IO sets for a task -type Creation func(id string) (IO, error) +// Creator creates new IO sets for a task +type Creator func(id string) (IO, error) // Attach allows callers to reattach to running tasks // @@ -61,13 +61,13 @@ func NewFIFOSet(config Config, close func() error) *FIFOSet { return &FIFOSet{Config: config, close: close} } -// NewIO returns an Creation that will provide IO sets without a terminal -func NewIO(stdin io.Reader, stdout, stderr io.Writer) Creation { +// NewIO returns an Creator that will provide IO sets without a terminal +func NewIO(stdin io.Reader, stdout, stderr io.Writer) Creator { return NewIOWithTerminal(stdin, stdout, stderr, false) } // NewIOWithTerminal creates a new io set with the provided io.Reader/Writers for use with a terminal -func NewIOWithTerminal(stdin io.Reader, stdout, stderr io.Writer, terminal bool) Creation { +func NewIOWithTerminal(stdin io.Reader, stdout, stderr io.Writer, terminal bool) Creator { return func(id string) (IO, error) { fifos, err := newFIFOSetInTempDir(id) if err != nil { diff --git a/container.go b/container.go index 1f0e9be2a..ad60c69ea 100644 --- a/container.go +++ b/container.go @@ -27,7 +27,7 @@ type Container interface { // Delete removes the container Delete(context.Context, ...DeleteOpts) error // NewTask creates a new task based on the container metadata - NewTask(context.Context, cio.Creation, ...NewTaskOpts) (Task, error) + NewTask(context.Context, cio.Creator, ...NewTaskOpts) (Task, error) // Spec returns the OCI runtime specification Spec(context.Context) (*specs.Spec, error) // Task returns the current task for the container @@ -163,7 +163,7 @@ func (c *container) Image(ctx context.Context) (Image, error) { }, nil } -func (c *container) NewTask(ctx context.Context, ioCreate cio.Creation, opts ...NewTaskOpts) (_ Task, err error) { +func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...NewTaskOpts) (_ Task, err error) { i, err := ioCreate(c.id) if err != nil { return nil, err diff --git a/container_test.go b/container_test.go index 3a1324bfc..e3ab0cf27 100644 --- a/container_test.go +++ b/container_test.go @@ -23,7 +23,7 @@ import ( gogotypes "github.com/gogo/protobuf/types" ) -func empty() cio.Creation { +func empty() cio.Creator { // TODO (@mlaventure) windows searches for pipes // when none are provided if runtime.GOOS == "windows" { diff --git a/task.go b/task.go index 28f49fa6c..121da9af5 100644 --- a/task.go +++ b/task.go @@ -123,7 +123,7 @@ type Task interface { // Resume the execution of the task Resume(context.Context) error // Exec creates a new process inside the task - Exec(context.Context, string, *specs.Process, cio.Creation) (Process, error) + Exec(context.Context, string, *specs.Process, cio.Creator) (Process, error) // Pids returns a list of system specific process ids inside the task Pids(context.Context) ([]ProcessInfo, error) // Checkpoint serializes the runtime and memory information of a task into an @@ -278,7 +278,7 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat return &ExitStatus{code: r.ExitStatus, exitedAt: r.ExitedAt}, nil } -func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate cio.Creation) (_ Process, err error) { +func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreate cio.Creator) (_ Process, err error) { if id == "" { return nil, errors.Wrapf(errdefs.ErrInvalidArgument, "exec id must not be empty") }