Merge pull request #3878 from crosbymichael/bump-console
Bump containerd console for os.File changes
This commit is contained in:
commit
e8948e11aa
@ -2,7 +2,7 @@ github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e02011
|
|||||||
github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005 # v0.3.1
|
github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005 # v0.3.1
|
||||||
github.com/containerd/btrfs af5082808c833de0e79c1e72eea9fea239364877
|
github.com/containerd/btrfs af5082808c833de0e79c1e72eea9fea239364877
|
||||||
github.com/containerd/cgroups abd0b19954a6b05e0963f48427062d1481b7faad
|
github.com/containerd/cgroups abd0b19954a6b05e0963f48427062d1481b7faad
|
||||||
github.com/containerd/console 0650fd9eeb50bab4fc99dceb9f2e14cf58f36e7f
|
github.com/containerd/console 02ecf6a7291e65f4a361525245c2bea023dc2e0b
|
||||||
github.com/containerd/continuity f2a389ac0a02ce21c09edd7344677a601970f41c
|
github.com/containerd/continuity f2a389ac0a02ce21c09edd7344677a601970f41c
|
||||||
github.com/containerd/fifo bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13
|
github.com/containerd/fifo bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13
|
||||||
github.com/containerd/go-runc a5c2862aed5e6358b305b0e16bfce58e0549b1cd
|
github.com/containerd/go-runc a5c2862aed5e6358b305b0e16bfce58e0549b1cd
|
||||||
|
19
vendor/github.com/containerd/console/console.go
generated
vendored
19
vendor/github.com/containerd/console/console.go
generated
vendored
@ -24,10 +24,17 @@ import (
|
|||||||
|
|
||||||
var ErrNotAConsole = errors.New("provided file is not a console")
|
var ErrNotAConsole = errors.New("provided file is not a console")
|
||||||
|
|
||||||
|
type File interface {
|
||||||
|
io.ReadWriteCloser
|
||||||
|
|
||||||
|
// Fd returns its file descriptor
|
||||||
|
Fd() uintptr
|
||||||
|
// Name returns its file name
|
||||||
|
Name() string
|
||||||
|
}
|
||||||
|
|
||||||
type Console interface {
|
type Console interface {
|
||||||
io.Reader
|
File
|
||||||
io.Writer
|
|
||||||
io.Closer
|
|
||||||
|
|
||||||
// Resize resizes the console to the provided window size
|
// Resize resizes the console to the provided window size
|
||||||
Resize(WinSize) error
|
Resize(WinSize) error
|
||||||
@ -42,10 +49,6 @@ type Console interface {
|
|||||||
Reset() error
|
Reset() error
|
||||||
// Size returns the window size of the console
|
// Size returns the window size of the console
|
||||||
Size() (WinSize, error)
|
Size() (WinSize, error)
|
||||||
// Fd returns the console's file descriptor
|
|
||||||
Fd() uintptr
|
|
||||||
// Name returns the console's file name
|
|
||||||
Name() string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WinSize specifies the window size of the console
|
// WinSize specifies the window size of the console
|
||||||
@ -70,7 +73,7 @@ func Current() Console {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ConsoleFromFile returns a console using the provided file
|
// ConsoleFromFile returns a console using the provided file
|
||||||
func ConsoleFromFile(f *os.File) (Console, error) {
|
func ConsoleFromFile(f File) (Console, error) {
|
||||||
if err := checkConsole(f); err != nil {
|
if err := checkConsole(f); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
6
vendor/github.com/containerd/console/console_unix.go
generated
vendored
6
vendor/github.com/containerd/console/console_unix.go
generated
vendored
@ -47,7 +47,7 @@ func NewPty() (Console, string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type master struct {
|
type master struct {
|
||||||
f *os.File
|
f File
|
||||||
original *unix.Termios
|
original *unix.Termios
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ func (m *master) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// checkConsole checks if the provided file is a console
|
// checkConsole checks if the provided file is a console
|
||||||
func checkConsole(f *os.File) error {
|
func checkConsole(f File) error {
|
||||||
var termios unix.Termios
|
var termios unix.Termios
|
||||||
if tcget(f.Fd(), &termios) != nil {
|
if tcget(f.Fd(), &termios) != nil {
|
||||||
return ErrNotAConsole
|
return ErrNotAConsole
|
||||||
@ -130,7 +130,7 @@ func checkConsole(f *os.File) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMaster(f *os.File) (Console, error) {
|
func newMaster(f File) (Console, error) {
|
||||||
m := &master{
|
m := &master{
|
||||||
f: f,
|
f: f,
|
||||||
}
|
}
|
||||||
|
4
vendor/github.com/containerd/console/console_windows.go
generated
vendored
4
vendor/github.com/containerd/console/console_windows.go
generated
vendored
@ -198,7 +198,7 @@ func makeInputRaw(fd windows.Handle, mode uint32) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkConsole(f *os.File) error {
|
func checkConsole(f File) error {
|
||||||
var mode uint32
|
var mode uint32
|
||||||
if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil {
|
if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -206,7 +206,7 @@ func checkConsole(f *os.File) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMaster(f *os.File) (Console, error) {
|
func newMaster(f File) (Console, error) {
|
||||||
if f != os.Stdin && f != os.Stdout && f != os.Stderr {
|
if f != os.Stdin && f != os.Stdout && f != os.Stderr {
|
||||||
return nil, errors.New("creating a console from a file is not supported on windows")
|
return nil, errors.New("creating a console from a file is not supported on windows")
|
||||||
}
|
}
|
||||||
|
8
vendor/github.com/containerd/console/go.mod
generated
vendored
Normal file
8
vendor/github.com/containerd/console/go.mod
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module github.com/containerd/console
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/pkg/errors v0.8.1
|
||||||
|
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user