utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorInvalidConnection = errors.New("invalid connection")

Functions

func FingerprintKey

func FingerprintKey(k ssh.PublicKey) string

func HandleTCPStream

func HandleTCPStream(src io.ReadWriteCloser, remote string)

func NewSshConn

func NewSshConn(conn ssh.Conn, remote string) (net.Conn, error)

func NewWebSocketConn

func NewWebSocketConn(websocketConn *websocket.Conn) net.Conn

func Pipe

func Pipe(src io.ReadWriteCloser, dst io.ReadWriteCloser) (int64, int64)

Types

type Agents

type Agents struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func FakeAgents

func FakeAgents() *Agents

func NewAgents

func NewAgents() *Agents

func (*Agents) Add

func (g *Agents) Add(cluster *v1alpha1.Cluster)

Add adds an agent to the list

func (*Agents) Del

func (g *Agents) Del(key string)

Delete an agent from the list

func (*Agents) Get

func (g *Agents) Get(key string) (*v1alpha1.Cluster, bool)

Get agent from the index by key

func (*Agents) Len

func (g *Agents) Len() int

Len returns the number of agents

func (*Agents) Set

func (g *Agents) Set(key string, agent *v1alpha1.Cluster)

Set an agent into the list by specific key

type SshConn

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

func (*SshConn) Close

func (s *SshConn) Close() error

func (*SshConn) LocalAddr

func (s *SshConn) LocalAddr() net.Addr

func (*SshConn) Network

func (s *SshConn) Network() string

func (*SshConn) Read

func (s *SshConn) Read(b []byte) (n int, err error)

func (*SshConn) RemoteAddr

func (s *SshConn) RemoteAddr() net.Addr

func (*SshConn) SetDeadline

func (s *SshConn) SetDeadline(t time.Time) error

func (*SshConn) SetReadDeadline

func (s *SshConn) SetReadDeadline(t time.Time) error

func (*SshConn) SetWriteDeadline

func (s *SshConn) SetWriteDeadline(t time.Time) error

func (*SshConn) String

func (s *SshConn) String() string

func (*SshConn) Write

func (s *SshConn) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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