utils

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivateKeyName = "tsm-private.pem"
	PublicKeyName  = "tsm-public.pem"
)

Variables

View Source
var (
	Db       *sql.DB
	BasePath string
)
View Source
var (
	PriKey []byte
	PubKey []byte
)

Functions

func CheckErr

func CheckErr(err error)

CheckErr 检测并panic error

func DecryptByPrivate

func DecryptByPrivate(cipherByte []byte, privateKey []byte) (plainText string, err error)

DecryptByPrivate 私钥解密

func EncryptByPublic

func EncryptByPublic(plain string, publicKey []byte) (cipherByte []byte, err error)

EncryptByPublic 公钥加密

func PathExists

func PathExists(path string) (bool, error)

PathExists 检测文件/目录是否存在

Types

type Terminal

type Terminal struct {
	Name   string
	Host   string
	Port   string
	User   string
	Pass   string
	Client *ssh.Client
}

Terminal 终端结构体

func (*Terminal) Connect

func (terminal *Terminal) Connect()

Connect 建立连接

func (*Terminal) NewSession

func (terminal *Terminal) NewSession()

NewSession 开启新的会话

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL