handler

package
v0.0.0-...-539d32a Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAsset selectType = iota + 1
	TypeNodeAsset
	TypeK8s
	TypeDatabase
)
View Source
const PAGESIZEALL = 0

Variables

This section is empty.

Functions

func CompareIP

func CompareIP(ipA, ipB string) bool

func CompareString

func CompareString(a, b string) bool

func ConstructNodeTree

func ConstructNodeTree(assetNodes []model.Node) treeprint.Tree

func JoinRoom

func JoinRoom(h *InteractiveHandler, roomId string)

func NewWriterAt

func NewWriterAt(f *sftp.File) io.WriterAt

Types

type ColorMeta

type ColorMeta struct {
	GreenBoldColor string
	ColorEnd       string
}

type DirectHandler

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

func NewDirectHandler

func NewDirectHandler(sess ssh.Session, jmsService *service.JMService, optSetters ...DirectOpt) (*DirectHandler, error)

func (*DirectHandler) Dispatch

func (d *DirectHandler) Dispatch()

func (*DirectHandler) LoginAsset

func (d *DirectHandler) LoginAsset()

func (*DirectHandler) LoginConnectToken

func (d *DirectHandler) LoginConnectToken()

func (*DirectHandler) NewSFTPHandler

func (d *DirectHandler) NewSFTPHandler() *SftpHandler

func (*DirectHandler) Proxy

func (d *DirectHandler) Proxy(asset model.Asset)

func (*DirectHandler) WatchWinSizeChange

func (d *DirectHandler) WatchWinSizeChange(winChan <-chan ssh.Window)

type DirectOpt

type DirectOpt func(*directOpt)

func DirectConnectSftpMode

func DirectConnectSftpMode(sftpMode bool) DirectOpt

func DirectConnectToken

func DirectConnectToken(tokenInfo *model.ConnectTokenInfo) DirectOpt

func DirectFormatType

func DirectFormatType(format FormatType) DirectOpt

func DirectTargetAsset

func DirectTargetAsset(targetAsset string) DirectOpt

func DirectTargetSystemUser

func DirectTargetSystemUser(targetSystemUser string) DirectOpt

func DirectTerminalConf

func DirectTerminalConf(conf *model.TerminalConfig) DirectOpt

func DirectUser

func DirectUser(User *model.User) DirectOpt

type FormatType

type FormatType int
const (
	FormatNORMAL FormatType = iota
	FormatUUID
	FormatToken
)

type HostnameAssetList

type HostnameAssetList []map[string]interface{}

func (HostnameAssetList) Len

func (l HostnameAssetList) Len() int

func (HostnameAssetList) Less

func (l HostnameAssetList) Less(i, j int) bool

func (HostnameAssetList) Swap

func (l HostnameAssetList) Swap(i, j int)

type IPAssetList

type IPAssetList []map[string]interface{}

func (IPAssetList) Len

func (l IPAssetList) Len() int

func (IPAssetList) Less

func (l IPAssetList) Less(i, j int) bool

func (IPAssetList) Swap

func (l IPAssetList) Swap(i, j int)

type InteractiveHandler

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

func NewInteractiveHandler

func NewInteractiveHandler(sess ssh.Session, user *model.User, jmsService *service.JMService,
	termConfig model.TerminalConfig) *InteractiveHandler

func (*InteractiveHandler) ChangeLang

func (h *InteractiveHandler) ChangeLang()

func (*InteractiveHandler) CheckShareRoomReadPerm

func (h *InteractiveHandler) CheckShareRoomReadPerm(shareRoomID string) bool

func (*InteractiveHandler) CheckShareRoomWritePerm

func (h *InteractiveHandler) CheckShareRoomWritePerm(shareRoomID string) bool

func (*InteractiveHandler) Dispatch

func (h *InteractiveHandler) Dispatch()

func (*InteractiveHandler) Initial

func (h *InteractiveHandler) Initial()

func (*InteractiveHandler) WatchWinSizeChange

func (h *InteractiveHandler) WatchWinSizeChange(winChan <-chan ssh.Window)
type Menu []MenuItem
type MenuItem struct {
	// contains filtered or unexported fields
}

type SftpHandler

type SftpHandler struct {
	*srvconn.UserSftpConn
}

func NewSFTPHandler

func NewSFTPHandler(jmsService *service.JMService, user *model.User, addr string) *SftpHandler

func (*SftpHandler) Close

func (fs *SftpHandler) Close()

func (*SftpHandler) Filecmd

func (fs *SftpHandler) Filecmd(r *sftp.Request) (err error)

func (*SftpHandler) Filelist

func (fs *SftpHandler) Filelist(r *sftp.Request) (sftp.ListerAt, error)

func (*SftpHandler) Fileread

func (fs *SftpHandler) Fileread(r *sftp.Request) (io.ReaderAt, error)

func (*SftpHandler) Filewrite

func (fs *SftpHandler) Filewrite(r *sftp.Request) (io.WriterAt, error)

type UserSelectHandler

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

func (*UserSelectHandler) AutoCompletion

func (u *UserSelectHandler) AutoCompletion()

func (UserSelectHandler) CurrentOffSet

func (p UserSelectHandler) CurrentOffSet() int

func (UserSelectHandler) CurrentPage

func (p UserSelectHandler) CurrentPage() int

func (*UserSelectHandler) DisplayCurrentResult

func (u *UserSelectHandler) DisplayCurrentResult()

func (*UserSelectHandler) HasNext

func (u *UserSelectHandler) HasNext() bool

func (*UserSelectHandler) HasPrev

func (u *UserSelectHandler) HasPrev() bool

func (*UserSelectHandler) MoveNextPage

func (u *UserSelectHandler) MoveNextPage()

func (*UserSelectHandler) MovePrePage

func (u *UserSelectHandler) MovePrePage()

func (UserSelectHandler) PageSize

func (p UserSelectHandler) PageSize() int

func (*UserSelectHandler) Proxy

func (u *UserSelectHandler) Proxy(target map[string]interface{})

func (*UserSelectHandler) Retrieve

func (u *UserSelectHandler) Retrieve(pageSize, offset int, searches ...string) []map[string]interface{}

func (*UserSelectHandler) Search

func (u *UserSelectHandler) Search(key string)

func (*UserSelectHandler) SearchAgain

func (u *UserSelectHandler) SearchAgain(key string)

func (*UserSelectHandler) SearchOrProxy

func (u *UserSelectHandler) SearchOrProxy(key string)

func (*UserSelectHandler) SetAllLocalData

func (u *UserSelectHandler) SetAllLocalData(data []map[string]interface{})

func (*UserSelectHandler) SetLoadPolicy

func (u *UserSelectHandler) SetLoadPolicy(policy dataSource)

func (*UserSelectHandler) SetNode

func (u *UserSelectHandler) SetNode(node model.Node)

func (*UserSelectHandler) SetSelectType

func (u *UserSelectHandler) SetSelectType(s selectType)

func (UserSelectHandler) TotalCount

func (p UserSelectHandler) TotalCount() int

func (UserSelectHandler) TotalPage

func (p UserSelectHandler) TotalPage() int

type WrapperSession

type WrapperSession struct {
	Uuid string
	Sess ssh.Session
	// contains filtered or unexported fields
}

func NewWrapperSession

func NewWrapperSession(sess ssh.Session) *WrapperSession

func (*WrapperSession) Close

func (w *WrapperSession) Close() error

func (*WrapperSession) Context

func (w *WrapperSession) Context() context.Context

func (*WrapperSession) HandleRoomEvent

func (w *WrapperSession) HandleRoomEvent(event string, msg *exchange.RoomMessage)

func (*WrapperSession) ID

func (w *WrapperSession) ID() string

func (*WrapperSession) LoginFrom

func (w *WrapperSession) LoginFrom() string

func (*WrapperSession) Pty

func (w *WrapperSession) Pty() ssh.Pty

func (*WrapperSession) Read

func (w *WrapperSession) Read(p []byte) (int, error)

func (*WrapperSession) RemoteAddr

func (w *WrapperSession) RemoteAddr() string

func (*WrapperSession) SetWin

func (w *WrapperSession) SetWin(win ssh.Window)

func (*WrapperSession) WinCh

func (w *WrapperSession) WinCh() (winch <-chan ssh.Window)

func (*WrapperSession) Write

func (w *WrapperSession) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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