Documentation
¶
Overview ¶
Copyright 2017 Mirantis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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 ¶
based on https://github.com/kubernetes-incubator/cri-o/blob/master/utils/utils.go#L90 CopyDetachable is similar to io.Copy but support a detach key sequence to break out.
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 NewServer ¶
func NewServer(kubernetesDir, socketPath string, metadataStore metadata.MetadataStore) (*Server, error)
NewServer creates a new Server
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 registerd 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