package stdio
import "github.com/Microsoft/hcsshim/internal/guest/stdio"
Index ¶
- func NewConsole() (*os.File, string, error)
- func ResizeConsole(pty *os.File, height, width uint16) error
- type ConnectionSet
- func Connect(tport transport.Transport, settings ConnectionSettings) (_ *ConnectionSet, err error)
- func (s *ConnectionSet) Close() error
- func (s *ConnectionSet) Files() (_ *FileSet, err error)
- type ConnectionSettings
- type FileSet
- type PipeRelay
- func NewPipeRelay(s *ConnectionSet) (_ *PipeRelay, err error)
- func (pr *PipeRelay) CloseUnusedPipes()
- func (pr *PipeRelay) Files() (*FileSet, error)
- func (pr *PipeRelay) ReplaceConnectionSet(s *ConnectionSet)
- func (pr *PipeRelay) Start()
- func (pr *PipeRelay) Wait()
- type TtyRelay
Functions ¶
func NewConsole ¶
NewConsole allocates a new console and returns the File for its master and path for its slave.
func ResizeConsole ¶
ResizeConsole sends the appropriate resize to a pTTY FD Synchronization of pty should be handled in the callers context.
Types ¶
type ConnectionSet ¶
type ConnectionSet struct { In, Out, Err transport.Connection }
ConnectionSet is a structure defining the readers and writers the Core implementation should forward a process's stdio through.
func Connect ¶
func Connect(tport transport.Transport, settings ConnectionSettings) (_ *ConnectionSet, err error)
Connect returns new transport.Connection instances, one for each stdio pipe to be used. If CreateStd*Pipe for a given pipe is false, the given Connection is set to nil.
func (*ConnectionSet) Close ¶
func (s *ConnectionSet) Close() error
Close closes each stdio connection.
func (*ConnectionSet) Files ¶
func (s *ConnectionSet) Files() (_ *FileSet, err error)
Files returns a FileSet with an os.File for each connection in the connection set.
type ConnectionSettings ¶
ConnectionSettings describe the stdin, stdout, stderr ports to connect the transport to. A nil port specifies no connection.
type FileSet ¶
FileSet represents the stdio of a process. It contains os.File types for in, out, err.
func (*FileSet) Close ¶
Close closes all the FileSet handles.
type PipeRelay ¶
type PipeRelay struct {
// contains filtered or unexported fields
}
PipeRelay is a relay built to expose a pipe interface for stdin, stdout, stderr on top of a ConnectionSet.
func NewPipeRelay ¶
func NewPipeRelay(s *ConnectionSet) (_ *PipeRelay, err error)
NewPipeRelay returns a new pipe relay wrapping the given connection stdin, stdout, stderr set. If s is nil will assume al stdin, stdout, stderr pipes.
func (*PipeRelay) CloseUnusedPipes ¶
func (pr *PipeRelay) CloseUnusedPipes()
CloseUnusedPipes gives the caller the ability to close any pipes that do not have a corresponding entry on the ConnectionSet. This is to be used in conjunction with NewPipeRelay where s is nil which wil open all pipes and later calling ReplaceConnectionSet with the actual connections.
func (*PipeRelay) Files ¶
Files returns a FileSet with an os.File for each connection in the connection set.
func (*PipeRelay) ReplaceConnectionSet ¶
func (pr *PipeRelay) ReplaceConnectionSet(s *ConnectionSet)
ReplaceConnectionSet allows the caller to add a new destination set after creating the relay. This can only be called previous to the call to Start.
func (*PipeRelay) Start ¶
func (pr *PipeRelay) Start()
Start starts the relay operation. The caller must call Wait to wait for the relay to finish and release the associated resources.
func (*PipeRelay) Wait ¶
func (pr *PipeRelay) Wait()
Wait waits for the relaying to finish and closes the associated pipes and connections.
type TtyRelay ¶
type TtyRelay struct {
// contains filtered or unexported fields
}
TtyRelay relays IO between a set of stdio connections and a master PTY file.
func NewTtyRelay ¶
func NewTtyRelay(s *ConnectionSet, pty *os.File) *TtyRelay
NewTtyRelay returns a new TTY relay for a given master PTY file.
func (*TtyRelay) ReplaceConnectionSet ¶
func (r *TtyRelay) ReplaceConnectionSet(s *ConnectionSet)
ReplaceConnectionSet allows the caller to add a new destination set after creating the relay. This can only be called previous to the call to Start.
func (*TtyRelay) ResizeConsole ¶
ResizeConsole sends the appropriate resize to a pTTY FD.
func (*TtyRelay) Start ¶
func (r *TtyRelay) Start()
Start starts the relay operation. The caller must call Wait to wait for the relay to finish and release the associated resources.
func (*TtyRelay) Wait ¶
func (r *TtyRelay) Wait()
Wait waits for the relaying to finish and closes the associated files and connections.
Source Files ¶
connection.go doc.go stdio.go tty.go
- Version
- v0.12.9 (latest)
- Published
- Oct 30, 2024
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 14 hours ago –
Tools for package owners.