cloudstream

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

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) Close

func (s *Session) Close()

func (*Session) DeleteAPIServerConnection

func (s *Session) DeleteAPIServerConnection(con APIServerConnection)

func (*Session) ProxyTunnelMessageToApiserver

func (s *Session) ProxyTunnelMessageToApiserver(message *stream.Message) error

func (*Session) Serve

func (s *Session) Serve()

Serve read tunnel message ,and write to specific apiserver connection

func (*Session) String

func (s *Session) String() string

func (*Session) WriteMessageToTunnel

func (s *Session) WriteMessageToTunnel(m *stream.Message) error

type StreamServer

type StreamServer struct {
	// contains filtered or unexported fields
}

func (*StreamServer) Start

func (s *StreamServer) Start()

type TunnelServer

type TunnelServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*TunnelServer) Start

func (s *TunnelServer) Start()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL