Documentation ¶
Index ¶
- func AesDecrypt(cryted string, key string) ([]byte, error)
- func AesEncrypt(origData []byte, key string) (string, error)
- func BrowserOpen(url string) error
- func DesDecrypt(decrypted string, key []byte) (string, error)
- func DesEncrypt(text string, key []byte) (string, error)
- func NewDingHook(url, app string, thresholdLevel logrus.Level) *dingHook
- func NewSshClientConfig(sshUser, sshPassword, sshType, sshKey, sshKeyPassword string) (config *ssh.ClientConfig, err error)
- func PKCS7Padding(ciphertext []byte, blocksize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func ParseUrlPage(href, div, jekyllDir string) error
- func ParseUrlPageJianshu(href, div, jekyllDir string) error
- func ParseUrlPageLibraGen(href, div, jekyllDir string) error
- func RandStringDigit(n int) string
- func RandStringWordC(n int) string
- func RandStringWordL(n int) string
- func RandStringWordU(n int) string
- func RandomString(n int) string
- func SshRemoteRunCommand(sshClient *ssh.Client, command string) (string, error)
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type Option
- type SshConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesEncrypt ¶
https://tech.mojotv.cn/2019/06/28/golang-crypt#svekr key length must be 16/24/32
func BrowserOpen ¶
func NewDingHook ¶
func NewSshClientConfig ¶
func NewSshClientConfig(sshUser, sshPassword, sshType, sshKey, sshKeyPassword string) (config *ssh.ClientConfig, err error)
func ParseUrlPage ¶
func ParseUrlPageJianshu ¶
func ParseUrlPageLibraGen ¶
func RandStringDigit ¶
func RandStringWordC ¶
func RandStringWordL ¶
func RandStringWordU ¶
func RandomString ¶
func SshRemoteRunCommand ¶
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type SshConn ¶
type SshConn struct { // calling Write() to write data into ssh server StdinPipe io.WriteCloser // Write() be called to receive data from ssh server ComboOutput *wsBufferWriter Session *ssh.Session }
connect to ssh server using ssh session.
func NewSshConn ¶
setup ssh shell session set Session and StdinPipe here, and the Session.Stdout and Session.Sdterr are also set.
func (*SshConn) ReceiveWsMsg ¶
func (ssConn *SshConn) ReceiveWsMsg(wsConn *websocket.Conn, logBuff *bytes.Buffer, exitCh chan bool)
ReceiveWsMsg receive websocket msg do some handling then write into ssh.session.stdin
func (*SshConn) SendComboOutput ¶
func (*SshConn) SessionWait ¶
Click to show internal directories.
Click to hide internal directories.