Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddCommonSwitch ¶
func AddCommonSwitch(s *SwitchSession)
func GetAliveSessions ¶
func GetAliveSessions() []string
func RemoveCommonSwitch ¶
func RemoveCommonSwitch(s *SwitchSession)
Types ¶
type ConnectionOption ¶
type ConnectionOption func(options *ConnectionOptions)
func ConnectAsset ¶
func ConnectAsset(asset *model.Asset) ConnectionOption
func ConnectSystemUser ¶
func ConnectSystemUser(systemUser *model.SystemUser) ConnectionOption
func ConnectUser ¶
func ConnectUser(user *model.User) ConnectionOption
type ConnectionOptions ¶
type ConnectionOptions struct {
// contains filtered or unexported fields
}
func (*ConnectionOptions) ConnectMsg ¶
func (opts *ConnectionOptions) ConnectMsg() string
func (*ConnectionOptions) TerminalTitle ¶
func (opts *ConnectionOptions) TerminalTitle() string
type ReplyRecorder ¶
type ReplyRecorder struct { SessionID string Target string Writer *common.AsciiWriter // contains filtered or unexported fields }
func NewReplayRecord ¶
func NewReplayRecord(sid, user, asset string, info *ReplyInfo) (*ReplyRecorder, error)
func (*ReplyRecorder) End ¶
func (r *ReplyRecorder) End()
func (*ReplyRecorder) Record ¶
func (r *ReplyRecorder) Record(p []byte)
type Server ¶
type Server struct { ID string UserConn UserConnection CreateSessionCallback func() error ConnectedSuccessCallback func() error ConnectedFailedCallback func(err error) error DisConnectedCallback func() error // contains filtered or unexported fields }
func NewServer ¶
func NewServer(conn UserConnection, core *core.Core, opts ...ConnectionOption) (*Server, error)
func (*Server) ConvertErrorToReadableMsg ¶
func (*Server) GetReplayRecorder ¶
func (s *Server) GetReplayRecorder() *ReplyRecorder
func (*Server) IsKeyboardMode ¶
type SwitchSession ¶
func GetSessionById ¶
func GetSessionById(id string) (s *SwitchSession, ok bool)
func (*SwitchSession) Bridge ¶
func (s *SwitchSession) Bridge(userConn UserConnection, srvConn srvconn.ServerConnection) (err error)
Bridge 桥接两个链接
func (*SwitchSession) SessionID ¶
func (s *SwitchSession) SessionID() string
func (*SwitchSession) Terminate ¶
func (s *SwitchSession) Terminate(username string)
Click to show internal directories.
Click to hide internal directories.