GithubHelp home page GithubHelp logo

rf-go-ssh's Introduction

rf-go-ssh

基于go语言的交换机ssh工具。 (huawei-switch)

version 0.1.0

Switch数据结构

Switch数据结构主要存放连接交换机需要使用的相关配置、会话、日志文件。

type Switch struct{
ip          string // 设备IP地址
port        string // 交换机端口
username    string // 登录设备用户名
password    string   // 登录设备密码
cmds        []string // 执行命令
session     *ssh.Session // 设备连接会话
inChan      chan string  // 输入通道
outChan     chan string  // 输出通道
lastUseTime time.Time    // 连接时间
OutLog      string       // 输出交互内容
Logger      *log.Logger // 日志记录
}

NewSwitchConnect()

创建Switch结构体,初始化ssh连接。配置回显不分页。返回类型:Switch

func NewSwitchConnect(ip, port, username, password string, )

初始化Switch,创建与交换机的连接


Switch.RunCommands(cmds ...string) (string, []string, error)

初始化

相关开源包

uuid logrus ssh

rf-go-ssh's People

Contributors

redfooox avatar

Stargazers

Leesing avatar

Watchers

 avatar

Forkers

bodhi369

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.