cloudstream

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CloudStreamModuleName = "cloudStream"
	CloudStreamGroupName  = "cloudStream"
)

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 inidecates 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 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 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