containerd: rename FifoSet to FIFOSet
Per Go's style guidelines, `Fifo` should be `FIFO` since it is an initialism. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
3332042ab6
commit
d738d6d1e4
@ -184,7 +184,7 @@ func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, erro
|
|||||||
var i *IO
|
var i *IO
|
||||||
if ioAttach != nil {
|
if ioAttach != nil {
|
||||||
// get the existing fifo paths from the task information stored by the daemon
|
// get the existing fifo paths from the task information stored by the daemon
|
||||||
paths := &FifoSet{
|
paths := &FIFOSet{
|
||||||
Dir: getFifoDir([]string{
|
Dir: getFifoDir([]string{
|
||||||
response.Task.Stdin,
|
response.Task.Stdin,
|
||||||
response.Task.Stdout,
|
response.Task.Stdout,
|
||||||
|
10
io.go
10
io.go
@ -27,7 +27,7 @@ func (i *IO) Close() error {
|
|||||||
|
|
||||||
type IOCreation func() (*IO, error)
|
type IOCreation func() (*IO, error)
|
||||||
|
|
||||||
type IOAttach func(*FifoSet) (*IO, error)
|
type IOAttach func(*FIFOSet) (*IO, error)
|
||||||
|
|
||||||
func NewIO(stdin io.Reader, stdout, stderr io.Writer) IOCreation {
|
func NewIO(stdin io.Reader, stdout, stderr io.Writer) IOCreation {
|
||||||
return NewIOWithTerminal(stdin, stdout, stderr, false)
|
return NewIOWithTerminal(stdin, stdout, stderr, false)
|
||||||
@ -61,7 +61,7 @@ func NewIOWithTerminal(stdin io.Reader, stdout, stderr io.Writer, terminal bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func WithAttach(stdin io.Reader, stdout, stderr io.Writer) IOAttach {
|
func WithAttach(stdin io.Reader, stdout, stderr io.Writer) IOAttach {
|
||||||
return func(paths *FifoSet) (*IO, error) {
|
return func(paths *FIFOSet) (*IO, error) {
|
||||||
if paths == nil {
|
if paths == nil {
|
||||||
return nil, fmt.Errorf("cannot attach to existing fifos")
|
return nil, fmt.Errorf("cannot attach to existing fifos")
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ func StdioTerminal() (*IO, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewFifos returns a new set of fifos for the task
|
// NewFifos returns a new set of fifos for the task
|
||||||
func NewFifos() (*FifoSet, error) {
|
func NewFifos() (*FIFOSet, error) {
|
||||||
root := filepath.Join(os.TempDir(), "containerd")
|
root := filepath.Join(os.TempDir(), "containerd")
|
||||||
if err := os.MkdirAll(root, 0700); err != nil {
|
if err := os.MkdirAll(root, 0700); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -106,7 +106,7 @@ func NewFifos() (*FifoSet, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &FifoSet{
|
return &FIFOSet{
|
||||||
Dir: dir,
|
Dir: dir,
|
||||||
In: filepath.Join(dir, "stdin"),
|
In: filepath.Join(dir, "stdin"),
|
||||||
Out: filepath.Join(dir, "stdout"),
|
Out: filepath.Join(dir, "stdout"),
|
||||||
@ -114,7 +114,7 @@ func NewFifos() (*FifoSet, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type FifoSet struct {
|
type FIFOSet struct {
|
||||||
// Dir is the directory holding the task fifos
|
// Dir is the directory holding the task fifos
|
||||||
Dir string
|
Dir string
|
||||||
In, Out, Err string
|
In, Out, Err string
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/containerd/fifo"
|
"github.com/containerd/fifo"
|
||||||
)
|
)
|
||||||
|
|
||||||
func copyIO(fifos *FifoSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
|
func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
|
||||||
var (
|
var (
|
||||||
f io.ReadWriteCloser
|
f io.ReadWriteCloser
|
||||||
ctx = context.Background()
|
ctx = context.Background()
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func copyIO(fifos *FifoSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
|
func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
if fifos.In != "" {
|
if fifos.In != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user