Documentation ¶
Index ¶
- func BuildClientByProperty(property *SSHProperty) (*ssh.Client, error)
- func BuildClientConfig(user string, password string, privateKeys []string) (*ssh.ClientConfig, error)
- func PtyClient(client *ssh.Client, term string, h, w int, modes ssh.TerminalModes) error
- func PtySession(session *ssh.Session, term string, h, w int, modes ssh.TerminalModes) error
- func Run(client *ssh.Client, cmd string) (string, error)
- func RunBatch(client *ssh.Client, cmds []string) (*shellkit.ResultTotal, error)
- func SimplePty(client *ssh.Client) error
- func SimplePtyByProperty(property *SSHProperty) error
- func SimplePtyFlat(addr string, user string, pwd string, prik string) error
- func SimplePtySession(session *ssh.Session) error
- func TunnelServe(lAddress string, mediumProperty *SSHProperty, dAddress string) error
- type SSHProperty
- type SSHPropertyPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClientByProperty ¶
func BuildClientByProperty(property *SSHProperty) (*ssh.Client, error)
func BuildClientConfig ¶
func PtySession ¶
func SimplePtyByProperty ¶
func SimplePtyByProperty(property *SSHProperty) error
func SimplePtySession ¶
func TunnelServe ¶
func TunnelServe(lAddress string, mediumProperty *SSHProperty, dAddress string) error
Types ¶
type SSHProperty ¶
type SSHProperty struct { Id string `yaml:"id"` Addr string `yaml:"addr"` User string `yaml:"user"` Password string `yaml:"password"` PublicKey string `yaml:"publicKey"` PrivateKey string `yaml:"privateKey"` }
func NewSSHConfigDefaultId ¶
func NewSSHConfigDefaultId(addr string) *SSHProperty
func NewSSHConfigSpecifyId ¶
func NewSSHConfigSpecifyId(id string, addr string) *SSHProperty
func (SSHProperty) GenSSHClientConfig ¶
func (p SSHProperty) GenSSHClientConfig() (*ssh.ClientConfig, error)
func (SSHProperty) GetPrivateKey ¶
func (p SSHProperty) GetPrivateKey() (string, error)
type SSHPropertyPool ¶
type SSHPropertyPool struct {
SSHParams []*SSHProperty
}
func GetSingleton ¶
func GetSingleton() *SSHPropertyPool
func (*SSHPropertyPool) Get ¶
func (pool *SSHPropertyPool) Get(id string) (*SSHProperty, error)
func (*SSHPropertyPool) Put ¶
func (pool *SSHPropertyPool) Put(config *SSHProperty)
func (*SSHPropertyPool) PutMulti ¶
func (pool *SSHPropertyPool) PutMulti(configs []*SSHProperty)
func (*SSHPropertyPool) PutNew ¶
func (pool *SSHPropertyPool) PutNew(id string, addr string) *SSHProperty
Click to show internal directories.
Click to hide internal directories.