util

package
v0.0.0-...-f4cebfc Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

https://gist.github.com/svett/b7f56afc966a6b6ac2fc
http://blog.ralch.com/tutorial/golang-ssh-connection/

package main

Index

Constants

View Source
const (
	Key_vagrant = `` /* 1674-byte string literal not displayed */

	Pub_vagrant = `` /* 408-byte string literal not displayed */
)

Variables

Functions

func PublicKeyFile

func PublicKeyFile(file string) ssh.AuthMethod

func PublicKeys

func PublicKeys(privatekey []byte) ssh.AuthMethod

func SSHAgent

func SSHAgent() ssh.AuthMethod

Types

type SSHClient

type SSHClient struct {
	Config *ssh.ClientConfig
	Host   string
	Port   int
}

func (*SSHClient) RunCommand

func (client *SSHClient) RunCommand(cmd *SSHCommand) error

type SSHCommand

type SSHCommand struct {
	Path   string
	Env    []string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type SSHConnectionConfig

type SSHConnectionConfig struct {
	SSHAgent bool
	SSHUser  SSHUserAuth
}

type SSHUserAuth

type SSHUserAuth struct {
	Name          string
	Password      string
	RSAKeyContent []byte
	RSAPubContent []byte
}

Directories

Path Synopsis
Inspired by: - https://github.com/kubernetes/client-go/blob/master/util/homedir/homedir.go Alternative: - https://github.com/mitchellh/go-homedir
Inspired by: - https://github.com/kubernetes/client-go/blob/master/util/homedir/homedir.go Alternative: - https://github.com/mitchellh/go-homedir

Jump to

Keyboard shortcuts

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