Documentation ¶
Index ¶
- func CopyDetachable(dst io.Writer, src io.Reader, keys []byte) (written int64, err error)
- func NewLogWriter(stdout <-chan []byte, logFile string, wg *sync.WaitGroup)
- type DetachError
- type Server
- func (s *Server) Attach(containerID string, inputStream io.Reader, ...) error
- func (s *Server) GetAttach(req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
- func (s *Server) GetPortForward(req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
- func (s *Server) PortForward(podSandboxID string, port int32, stream io.ReadWriteCloser) error
- func (s *Server) Start() error
- func (s *Server) Stop()
- type UnixServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDetachable ¶
CopyDetachable is similar to io.Copy but support a detach key sequence to break out. based on https://github.com/kubernetes-incubator/cri-o/blob/master/utils/utils.go#L90
Types ¶
type DetachError ¶
type DetachError struct{}
DetachError is special error which returned in case of container detach.
func (DetachError) Error ¶
func (DetachError) Error() string
type Server ¶
type Server struct { DeadlineSeconds int streaming.Runtime // contains filtered or unexported fields }
Server implements streaming.Runtime
func (*Server) Attach ¶
func (s *Server) Attach(containerID string, inputStream io.Reader, outputStream, errorStream io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error
Attach endpoint for streaming.Runtime
func (*Server) GetAttach ¶
func (s *Server) GetAttach(req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
GetAttach returns attach stream request
func (*Server) GetPortForward ¶
func (s *Server) GetPortForward(req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
GetPortForward returns pofrforward stream request
func (*Server) PortForward ¶
PortForward endpoint for streaming.Runtime
type UnixServer ¶
type UnixServer struct { SocketPath string UnixConnections *syncmap.Map // contains filtered or unexported fields }
UnixServer listens for connections from qemu instances and sends its stdout to registered channels.
func NewUnixServer ¶
func NewUnixServer(socketPath, kubernetesDir string) *UnixServer
NewUnixServer creates new UnixServer. Requires socketPath on which it will listen and kubernetesDir where logs will be written
func (*UnixServer) AddOutputReader ¶
func (u *UnixServer) AddOutputReader(containerID string, newChan chan []byte)
AddOutputReader adds a new channel for containerID to send stdout
func (*UnixServer) Listen ¶
func (u *UnixServer) Listen()
Listen starts listening for connections from qemus
func (*UnixServer) RemoveOutputReader ¶
func (u *UnixServer) RemoveOutputReader(containerID string, readerChan chan []byte)
RemoveOutputReader removes a channel for containerID
func (*UnixServer) Stop ¶
func (u *UnixServer) Stop()
Stop stops listening and waits for all writers to finish