kubernetes: github.com/ArdaXi/kubernetes/pkg/ssh Index | Files

package ssh

import "github.com/ArdaXi/kubernetes/pkg/ssh"

Index

Package Files

ssh.go

func EncodePrivateKey Uses

func EncodePrivateKey(private *rsa.PrivateKey) []byte

func EncodePublicKey Uses

func EncodePublicKey(public *rsa.PublicKey) ([]byte, error)

func EncodeSSHKey Uses

func EncodeSSHKey(public *rsa.PublicKey) ([]byte, error)

func GenerateKey Uses

func GenerateKey(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

func MakePrivateKeySignerFromBytes Uses

func MakePrivateKeySignerFromBytes(buffer []byte) (ssh.Signer, error)

func MakePrivateKeySignerFromFile Uses

func MakePrivateKeySignerFromFile(key string) (ssh.Signer, error)

func ParsePublicKeyFromFile Uses

func ParsePublicKeyFromFile(keyFile string) (*rsa.PublicKey, error)

func RunSSHCommand Uses

func RunSSHCommand(cmd, user, host string, signer ssh.Signer) (string, string, int, error)

RunSSHCommand returns the stdout, stderr, and exit code from running cmd on host as specific user, along with any SSH-level error. If user=="", it will default (like SSH) to os.Getenv("USER")

type SSHTunnel Uses

type SSHTunnel struct {
    Config  *ssh.ClientConfig
    Host    string
    SSHPort string
    // contains filtered or unexported fields
}

TODO: Unit tests for this code, we can spin up a test SSH server with instructions here: https://godoc.org/golang.org/x/crypto/ssh#ServerConn

func NewSSHTunnel Uses

func NewSSHTunnel(user, keyfile, host string) (*SSHTunnel, error)

func NewSSHTunnelFromBytes Uses

func NewSSHTunnelFromBytes(user string, privateKey []byte, host string) (*SSHTunnel, error)

func (*SSHTunnel) Close Uses

func (s *SSHTunnel) Close() error

func (*SSHTunnel) Dial Uses

func (s *SSHTunnel) Dial(network, address string) (net.Conn, error)

func (*SSHTunnel) Open Uses

func (s *SSHTunnel) Open() error

type SSHTunnelList Uses

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

func NewSSHTunnelList Uses

func NewSSHTunnelList(user, keyfile string, healthCheckURL *url.URL, stopChan chan struct{}) *SSHTunnelList

func (*SSHTunnelList) Dial Uses

func (l *SSHTunnelList) Dial(net, addr string) (net.Conn, error)

func (*SSHTunnelList) Update Uses

func (l *SSHTunnelList) Update(addrs []string)

Update reconciles the list's entries with the specified addresses. Existing tunnels that are not in addresses are removed from entries and closed in a background goroutine. New tunnels specified in addresses are opened in a background goroutine and then added to entries.

Package ssh imports 23 packages (graph). Updated 2017-02-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).