utl

package
v0.0.0-...-0d2c365 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConn

func CloseConn(host, jump *ssh.Client)

func ConnHost

func ConnHost(jumpCLient *ssh.Client, sshAddr string) (net.Conn, *ssh.Client, error)

func CreateSession

func CreateSession(connect *ssh.Client) (*ssh.Session, io.Reader)

func CreateSessionNoTrm

func CreateSessionNoTrm(connect *ssh.Client) (*ssh.Session, io.Reader)

func DialHost

func DialHost(sshConfig *ssh.ClientConfig, sshAddr string, sshPort int8) (*ssh.Client, error)

func FireCommands

func FireCommands(rmtHstSshClient *ssh.Client, commands ...string) (map[string]string, error)

func LoadFile

func LoadFile(flPth string) []byte

Opens a file and makes it available in byte array

func MakeNewClientConn

func MakeNewClientConn(remoteHostConn net.Conn, jmpBxSshClient *ssh.Client, remoteAddr string, remoteConfig *ssh.ClientConfig) (rmtHstSshClt, JumpSshClient *ssh.Client, err error)

func SourceHostName

func SourceHostName() string

Types

type BastionAuth

type BastionAuth struct {
	Name   string
	Uname  string `yaml:"bastion.uname"`
	Prefix string `yaml:"bastion.prefix"`
}

type DCDN

type DCDN struct {
	DataCenter string
	DomainName string `yaml:"domainName"`
}

type HJSShConfig

type HJSShConfig struct {
	HostAuth    *HostAuth
	BastionAuth *BastionAuth
	SSHConfig   *SShCfg
	Dx          *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 string) error

takes a host name and gives out full domain name and host name

type HostAuth

type HostAuth struct {
	Name  string
	Uname string `yaml:"host.uname"`
}

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 string) *ssh.ClientConfig

Jump to

Keyboard shortcuts

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