Documentation
¶
Index ¶
- func CloseConn(host, jump *ssh.Client)
- func ConnHost(jumpCLient *ssh.Client, sshAddr string, sshPort int8) (net.Conn, error)
- func CreateSession(connect *ssh.Client) *ssh.Session
- func CreateSessionNoTrm(connect *ssh.Client) (*ssh.Session, io.Reader)
- func CreateStdOutPipedSession(connect *ssh.Client) (*ssh.Session, io.Reader)
- func DialHost(sshConfig *ssh.ClientConfig, sshAddr string, sshPort int8) (*ssh.Client, error)
- func ExecuteCommand(rmtHstSshClient *ssh.Client, commands ...string) chan map[string]string
- func LoadFile(flPth string) []byte
- func MakeNewClientConn(remoteHostConn net.Conn, remoteAddr string, remoteConfig *ssh.ClientConfig) (rmtHstSshClt *ssh.Client, err error)
- func PrintHashMap(sessionOutChan chan map[string]string)
- func RunCommandStdOut(rmtHstSshClient *ssh.Client, commands ...string) (map[string]string, error)
- func SourceHostName() string
- type BastionAuth
- type DCDN
- type HJSShConfig
- func (hj *HJSShConfig) CreateSshClientHost() (*ssh.Client, error)
- func (hj *HJSShConfig) CreateSshClientJumpHost() (rmtHstSshClt, JumpSshClient *ssh.Client, err error)
- func (hj *HJSShConfig) DisplayHostDetails()
- func (hj *HJSShConfig) JumpOrNot() (host, jump *ssh.Client)
- func (hj *HJSShConfig) MapHostDc(hostname, sep string) error
- type HostAuth
- type SShCfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteCommand ¶
func MakeNewClientConn ¶
func PrintHashMap ¶
func RunCommandStdOut ¶
func SourceHostName ¶
func SourceHostName() string
Types ¶
type BastionAuth ¶
type HJSShConfig ¶
type HJSShConfig struct { HostAuth *HostAuth `yaml:"host"` BastionAuth *BastionAuth `yaml:"bastion"` SSHConfig *SShCfg `yaml:"ssh"` Dx *DCDN `yaml:"dcdn"` }
func ParseCfg ¶
func ParseCfg(yamlBuf []byte) *HJSShConfig
func (*HJSShConfig) CreateSshClientHost ¶
func (hj *HJSShConfig) CreateSshClientHost() (*ssh.Client, error)
func (*HJSShConfig) CreateSshClientJumpHost ¶
func (hj *HJSShConfig) CreateSshClientJumpHost() (rmtHstSshClt, JumpSshClient *ssh.Client, err error)
func (*HJSShConfig) DisplayHostDetails ¶
func (hj *HJSShConfig) DisplayHostDetails()
func (*HJSShConfig) JumpOrNot ¶
func (hj *HJSShConfig) JumpOrNot() (host, jump *ssh.Client)
func (*HJSShConfig) MapHostDc ¶
func (hj *HJSShConfig) MapHostDc(hostname, sep string) error
takes a host name and gives out full domain name and host name
type SShCfg ¶
type SShCfg struct { Path string `yaml:"ssh.path"` PK string `yaml:"ssh.pkname"` Port int8 `yaml:"ssh.port"` Jump bool `yaml:"ssh.jump"` }
func (*SShCfg) LoadSshConfig ¶
func (sh *SShCfg) LoadSshConfig(userName, hostName string) *ssh.ClientConfig
LoadSshConfig loads SSH configuration for a given user
Click to show internal directories.
Click to hide internal directories.