app

package
v0.0.0-...-456a8e1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func If

func If[T any](cond bool, a, b T) T

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func (*App) DoSCP

func (app *App) DoSCP(cfg *ScpConfig)

func (*App) DoSSH

func (app *App) DoSSH(cfg *SshConfig)

func (*App) DoTag

func (app *App) DoTag(idStr string, tagName string)

func (*App) Init

func (app *App) Init()

func (*App) ShowLastLoggedInDevices

func (app *App) ShowLastLoggedInDevices(n int)

func (*App) UploadDirectory

func (app *App) UploadDirectory(localFile, remoteFile string)

func (*App) UploadFile

func (app *App) UploadFile(localFile, remoteFile string)

type ScpConfig

type ScpConfig struct {
	SshConfig

	Dir bool // 上传/下载文件夹
	// contains filtered or unexported fields
}

ScpConfig

  • scp -P 22 -r ./file.tar anhk@10.226.133.9:/file.tar

func (*ScpConfig) Parse

func (cfg *ScpConfig) Parse(src, dst string) *ScpConfig

Parse 解析SCP命令

  • addr => anhk@10.226.133.9

type SshConfig

type SshConfig struct {
	Port int
	// contains filtered or unexported fields
}

SshConfig

  • ssh -p 22 anhk@10.226.133.9

func (*SshConfig) Parse

func (cfg *SshConfig) Parse(addr string) *SshConfig

Parse 解析SSH命令

  • addr => anhk@10.226.133.9
  • addr => anhk@10.226.133.9:/tmp/test

type SshInfo

type SshInfo struct {
	Id        int64
	UserName  string    `xorm:"varchar(64) not null comment('用户名')"`
	Password  string    `xorm:"varchar(256) null comment('密码')"`
	Address   string    `xorm:"varchar(256) not null comment('服务器地址')"`
	Port      int       `xorm:"int default 22 comment('端口')"`
	Tag       string    `xorm:"varchar(64) null comment('标签')'"`
	CreatedAt time.Time `xorm:"created"`
	UpdatedAt time.Time `xorm:"updated"`
}

Jump to

Keyboard shortcuts

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