Documentation ¶
Index ¶
- func AES_CBC_Decrypt(data string, key []byte) []byte
- func AES_CBC_Encrypt(plainText []byte, key []byte) string
- func B64Decode(input string) ([]byte, error)
- func B64DecodeString(input string) (string, error)
- func B64Encode(input string) string
- func CheckFileIsExist(filename string) bool
- func ConvertArray(arr []string) (bool, []int)
- func ConvertIntArrayToString(ids []int) string
- func GenFile(dir, fileName, data string) error
- func GetMac() (bool, string)
- func GetRandomString(num int) string
- func GetRandomStringBack(num int) string
- func GzipCompress(origin []byte) ([]byte, error)
- func HMacBySha256(key, toSign string) string
- func HeaderToString(h http.Header) string
- func HexEncode(body []byte) string
- func Intercept(str, substr string) (string, string)
- func JSONUnmarshal(s, v interface{}) error
- func JSObjectToJSON(s string) ([]byte, error)
- func Md5(encodeString string) string
- func MustSliceString(v interface{}) ([]string, error)
- func Padding(plainText []byte, blockSize int) []byte
- func QueryUrlEncode(rawQuery string) string
- func SSHClient(user, password, host, key string, port int, cipherList []string) (*ssh.Client, error)
- func SessionConnect(client *ssh.Client) (*ssh.Session, error)
- func SftpConnect(client *ssh.Client) (*sftp.Client, error)
- func Stop() bool
- func TrimPrefixAll(s string, r string) string
- func TrimSuffixAll(s string, r string) string
- func UnPadding(cipherText []byte) []byte
- func ValidateRemoteAddr(ip string) bool
- func ValidateURL(url string) bool
- type SftpClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AES_CBC_Decrypt ¶
AES_CBC_Decrypt AEC解密(CBC模式)
func AES_CBC_Encrypt ¶
AES_CBC_Encrypt AEC加密(CBC模式)
func B64DecodeString ¶ added in v0.9.0
B64Decode base64解密
func CheckFileIsExist ¶
CheckFileIsExist 判断文件是否存在 存在返回 true 不存在返回false
func ConvertIntArrayToString ¶
ConvertIntArrayToString 转换整型数组
func JSONUnmarshal ¶
func JSONUnmarshal(s, v interface{}) error
JSONUnmarshal 将json格式的s解码成v所需的json格式
func MustSliceString ¶
MustSliceString 断言输入的参数为字符串切片
func SSHClient ¶
func SSHClient(user, password, host, key string, port int, cipherList []string) (*ssh.Client, error)
SSHClient SSHClient
func SessionConnect ¶
SessionConnect SessionConnect
func SftpConnect ¶
SftpConnect SftpConnect
Types ¶
type SftpClient ¶
type SftpClient struct {
// contains filtered or unexported fields
}
SftpClient sftp客户端
func NewSftpClient ¶
func NewSftpClient(client *ssh.Client) (*SftpClient, error)
NewSftpClient new sftp客户端
func (*SftpClient) CheckPathIsExisted ¶
func (s *SftpClient) CheckPathIsExisted(path string) error
CheckPathIsExisted CheckPathIsExisted
func (*SftpClient) ScpCopy ¶
func (s *SftpClient) ScpCopy(localFilePath, remoteDir string) error
ScpCopy scp复制
Source Files ¶
Click to show internal directories.
Click to hide internal directories.