Documentation ¶
Index ¶
- func Register(controller *v1alpha1.CloudStream)
- type APIServerConnection
- type ContainerExecConnection
- func (c *ContainerExecConnection) EdgePeerDone() <-chan struct{}
- func (c *ContainerExecConnection) GetMessageID() uint64
- func (c *ContainerExecConnection) SendConnection() (stream.EdgedConnection, error)
- func (c *ContainerExecConnection) Serve() error
- func (c *ContainerExecConnection) SetEdgePeerDone()
- func (c *ContainerExecConnection) SetMessageID(id uint64)
- func (c *ContainerExecConnection) String() string
- func (c *ContainerExecConnection) WriteToAPIServer(p []byte) (n int, err error)
- func (c *ContainerExecConnection) WriteToTunnel(m *stream.Message) error
- type ContainerLogsConnection
- func (l *ContainerLogsConnection) EdgePeerDone() <-chan struct{}
- func (l *ContainerLogsConnection) GetMessageID() uint64
- func (l *ContainerLogsConnection) SendConnection() (stream.EdgedConnection, error)
- func (l *ContainerLogsConnection) Serve() error
- func (l *ContainerLogsConnection) SetEdgePeerDone()
- func (l *ContainerLogsConnection) SetMessageID(id uint64)
- func (l *ContainerLogsConnection) String() string
- func (l *ContainerLogsConnection) WriteToAPIServer(p []byte) (n int, err error)
- func (l *ContainerLogsConnection) WriteToTunnel(m *stream.Message) error
- type ContainerMetricsConnection
- func (ms *ContainerMetricsConnection) EdgePeerDone() <-chan struct{}
- func (ms *ContainerMetricsConnection) GetMessageID() uint64
- func (ms *ContainerMetricsConnection) SendConnection() (stream.EdgedConnection, error)
- func (ms *ContainerMetricsConnection) Serve() error
- func (ms *ContainerMetricsConnection) SetEdgePeerDone()
- func (ms *ContainerMetricsConnection) SetMessageID(id uint64)
- func (ms *ContainerMetricsConnection) String() string
- func (ms *ContainerMetricsConnection) WriteToAPIServer(p []byte) (n int, err error)
- func (ms *ContainerMetricsConnection) WriteToTunnel(m *stream.Message) error
- type Session
- func (s *Session) AddAPIServerConnection(ss *StreamServer, connection APIServerConnection) (APIServerConnection, error)
- func (s *Session) Close()
- func (s *Session) DeleteAPIServerConnection(con APIServerConnection)
- func (s *Session) ProxyTunnelMessageToApiserver(message *stream.Message) error
- func (s *Session) Serve()
- func (s *Session) String() string
- func (s *Session) WriteMessageToTunnel(m *stream.Message) error
- type StreamServer
- type TunnelServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(controller *v1alpha1.CloudStream)
Types ¶
type APIServerConnection ¶
type APIServerConnection interface { fmt.Stringer // SendConnection indicates send EdgedConnection to edge SendConnection() (stream.EdgedConnection, error) // WriteToTunnel indicates writing message to tunnel WriteToTunnel(m *stream.Message) error // WriteToAPIServer indicates writing data to apiserver response WriteToAPIServer(p []byte) (n int, err error) // SetMessageID indicates set messageid for it`s connection // Every APIServerConnection has his unique message id SetMessageID(id uint64) GetMessageID() uint64 // Serve indicates handling his own logic Serve() error // SetEdgePeerDone indicates send specifical message to let edge peer exist SetEdgePeerDone() // EdgePeerDone indicates whether edge peer ends EdgePeerDone() <-chan struct{} }
APIServerConnection indicates a connection request originally made by kube-apiserver to kubelet There are basically three types of connection requests : containersLogs, containerExec, Metric Cloudstream module first intercepts the connection request and then sends the request data through the tunnel (websocket) to edgestream module
type ContainerExecConnection ¶
type ContainerExecConnection struct { MessageID uint64 Conn net.Conn // contains filtered or unexported fields }
ContainerExecConnection indicates the container exec request initiated by kube-apiserver
func (*ContainerExecConnection) EdgePeerDone ¶
func (c *ContainerExecConnection) EdgePeerDone() <-chan struct{}
func (*ContainerExecConnection) GetMessageID ¶
func (c *ContainerExecConnection) GetMessageID() uint64
func (*ContainerExecConnection) SendConnection ¶
func (c *ContainerExecConnection) SendConnection() (stream.EdgedConnection, error)
func (*ContainerExecConnection) Serve ¶
func (c *ContainerExecConnection) Serve() error
func (*ContainerExecConnection) SetEdgePeerDone ¶
func (c *ContainerExecConnection) SetEdgePeerDone()
func (*ContainerExecConnection) SetMessageID ¶
func (c *ContainerExecConnection) SetMessageID(id uint64)
func (*ContainerExecConnection) String ¶
func (c *ContainerExecConnection) String() string
func (*ContainerExecConnection) WriteToAPIServer ¶
func (c *ContainerExecConnection) WriteToAPIServer(p []byte) (n int, err error)
func (*ContainerExecConnection) WriteToTunnel ¶
func (c *ContainerExecConnection) WriteToTunnel(m *stream.Message) error
type ContainerLogsConnection ¶
type ContainerLogsConnection struct { // MessageID indicate the unique id to create his message MessageID uint64 // contains filtered or unexported fields }
ContainerLogsConnection indicates the containerlogs request initiated by kube-apiserver
func (*ContainerLogsConnection) EdgePeerDone ¶
func (l *ContainerLogsConnection) EdgePeerDone() <-chan struct{}
func (*ContainerLogsConnection) GetMessageID ¶
func (l *ContainerLogsConnection) GetMessageID() uint64
func (*ContainerLogsConnection) SendConnection ¶
func (l *ContainerLogsConnection) SendConnection() (stream.EdgedConnection, error)
func (*ContainerLogsConnection) Serve ¶
func (l *ContainerLogsConnection) Serve() error
func (*ContainerLogsConnection) SetEdgePeerDone ¶
func (l *ContainerLogsConnection) SetEdgePeerDone()
func (*ContainerLogsConnection) SetMessageID ¶
func (l *ContainerLogsConnection) SetMessageID(id uint64)
func (*ContainerLogsConnection) String ¶
func (l *ContainerLogsConnection) String() string
func (*ContainerLogsConnection) WriteToAPIServer ¶
func (l *ContainerLogsConnection) WriteToAPIServer(p []byte) (n int, err error)
func (*ContainerLogsConnection) WriteToTunnel ¶
func (l *ContainerLogsConnection) WriteToTunnel(m *stream.Message) error
type ContainerMetricsConnection ¶
type ContainerMetricsConnection struct { // MessageID indicate the unique id to create his message MessageID uint64 // contains filtered or unexported fields }
ContainerMetricsConnection indicates the containerMetrics request initiated by kube-apiserver
func (*ContainerMetricsConnection) EdgePeerDone ¶
func (ms *ContainerMetricsConnection) EdgePeerDone() <-chan struct{}
func (*ContainerMetricsConnection) GetMessageID ¶
func (ms *ContainerMetricsConnection) GetMessageID() uint64
func (*ContainerMetricsConnection) SendConnection ¶
func (ms *ContainerMetricsConnection) SendConnection() (stream.EdgedConnection, error)
func (*ContainerMetricsConnection) Serve ¶
func (ms *ContainerMetricsConnection) Serve() error
func (*ContainerMetricsConnection) SetEdgePeerDone ¶
func (ms *ContainerMetricsConnection) SetEdgePeerDone()
func (*ContainerMetricsConnection) SetMessageID ¶
func (ms *ContainerMetricsConnection) SetMessageID(id uint64)
func (*ContainerMetricsConnection) String ¶
func (ms *ContainerMetricsConnection) String() string
func (*ContainerMetricsConnection) WriteToAPIServer ¶
func (ms *ContainerMetricsConnection) WriteToAPIServer(p []byte) (n int, err error)
func (*ContainerMetricsConnection) WriteToTunnel ¶
func (ms *ContainerMetricsConnection) WriteToTunnel(m *stream.Message) error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session indicates one tunnel connection (default websocket) from edgecore And multiple kube-apiserver initiated requests to this edgecore
func (*Session) AddAPIServerConnection ¶
func (s *Session) AddAPIServerConnection(ss *StreamServer, connection APIServerConnection) (APIServerConnection, error)
func (*Session) DeleteAPIServerConnection ¶
func (s *Session) DeleteAPIServerConnection(con APIServerConnection)
func (*Session) ProxyTunnelMessageToApiserver ¶
type StreamServer ¶
type StreamServer struct {
// contains filtered or unexported fields
}
func (*StreamServer) Start ¶
func (s *StreamServer) Start()
type TunnelServer ¶
func (*TunnelServer) Start ¶
func (s *TunnelServer) Start()