Documentation
¶
Index ¶
- Constants
- func CreateSSHConfig(user, password, privateKey, keyPwd string, timeOut int) (ssh.ClientConfig, error)
- func DecryptUserPwd(crypted string) (string, error)
- func EncryptPass(username, password, salt string) string
- func EncryptUserPwd(passwd []byte) (string, error)
- func GeneratePasswd() string
- func GenerateToken(username, password string) (string, error)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- type Claims
- type Result
- type SSHClient
Constants ¶
View Source
const ( NUmStr = "0123456789" CharStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" SpecStr = "+=-@#~,.[]()!%^*$" CommonKey = "95PmsApi20180704" )
Variables ¶
This section is empty.
Functions ¶
func CreateSSHConfig ¶
func CreateSSHConfig(user, password, privateKey, keyPwd string, timeOut int) (ssh.ClientConfig, error)
设置ssh所需的config
func PKCS7Padding ¶
func PKCS7UnPadding ¶
Types ¶
type Claims ¶
type SSHClient ¶
type SSHClient struct { Ip string User string Password string PrivateKey string PrivateKeyPwd string Port int Timeout int }
ssh client
func (*SSHClient) ParseConfig ¶
func (client *SSHClient) ParseConfig() (ssh.ClientConfig, error)
设置ssh所需的config
func (*SSHClient) SftpConnect ¶
建立sftp连接
Click to show internal directories.
Click to hide internal directories.