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 CheckObjectives(objectives string) bool
- func CheckUrlPath(path string) bool
- func ConvertArray(arr []string) (bool, []int)
- func ConvertIntArrayToString(ids []int) string
- func CopyMaps[K comparable, T any](maps map[K]T) map[K]T
- 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 InterfaceToString(value interface{}) string
- func IsMatchDomainPort(s string) bool
- func IsMatchIpPort(s string) bool
- func IsMatchSchemeDomainPort(s string) bool
- func IsMatchSchemeIpPort(s string) bool
- func JSONUnmarshal(s, v interface{}) error
- func JSObjectToJSON(s string) ([]byte, error)
- func JsonSchemaMockJsUnmarshal(valueMap interface{}) interface{}
- func Md5(encodeString string) string
- func MustSliceString(v interface{}) ([]string, error)
- func Padding(plainText []byte, blockSize int) []byte
- func QueryUrlEncode(rawQuery string) string
- func RandFloats(min, max float64) float64
- func RandInt64(min, max int64) int64
- 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 CheckObjectives ¶ added in v0.11.1
CheckObjectives 检查prometheus objectives配置 校验0.5:0.1,0.9:0.001的格式
func CheckUrlPath ¶ added in v0.11.1
func ConvertIntArrayToString ¶
ConvertIntArrayToString 转换整型数组
func CopyMaps ¶ added in v0.10.0
func CopyMaps[K comparable, T any](maps map[K]T) map[K]T
func InterfaceToString ¶ added in v0.10.0
func InterfaceToString(value interface{}) string
func IsMatchDomainPort ¶ added in v0.12.1
IsMatchDomainPort 判断字符串是否符合 域名或者域名:port
func IsMatchIpPort ¶ added in v0.12.1
IsMatchIpPort 判断字符串是否符合 ip:port或者ip
func IsMatchSchemeDomainPort ¶ added in v0.12.1
IsMatchSchemeDomainPort 判断字符串是否符合 scheme://域名或者域名:port
func IsMatchSchemeIpPort ¶ added in v0.12.1
IsMatchSchemeIpPort 判断字符串是否符合scheme://ip:port
func JSONUnmarshal ¶
func JSONUnmarshal(s, v interface{}) error
JSONUnmarshal 将json格式的s解码成v所需的json格式
func JsonSchemaMockJsUnmarshal ¶ added in v0.12.1
func JsonSchemaMockJsUnmarshal(valueMap interface{}) interface{}
JsonSchemaMockJsUnmarshal 解析mockJs生成的json schema 并根据规则生成随机值 不是mockJs生成的json 走默认规则解析
func MustSliceString ¶
MustSliceString 断言输入的参数为字符串切片
func RandFloats ¶ added in v0.12.1
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复制