Documentation
¶
Index ¶
- Variables
- func FileExited(filename string) func(string) error
- func FileNotExited(filename string) func(string) error
- func GetServerSSHUsersMenu(server Server, matchPolicies []Policy) func(int, MenuItem, *ssh.Session, []MenuItem) []MenuItem
- func GetServersMenuV2(sess *ssh.Session, user User) (map[string]MenuItem, error)
- func IsDir() func(string) error
- func IsInt() func(string) error
- func IsNotDir() func(string) error
- func MultiValidate(validates [](func(string) error)) func(string) error
- func Required(field string) func(string) error
- func YesOrNo() func(string) error
- type MenuItem
- type PUI
- func (ui *PUI) Exit()
- func (ui *PUI) FlashTimeout()
- func (ui *PUI) GetTimeout() string
- func (ui *PUI) IsLogout() bool
- func (ui *PUI) IsTimeout() bool
- func (ui *PUI) SessionWrite(msg string) error
- func (ui *PUI) ShowMainMenu()
- func (ui *PUI) ShowMenu(label string, menu []MenuItem, BackOptionLabel string, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MainLabel = "Please select,ctrl+c to return,ctrl+d to exit" ApproveSummaryLabel = "Please check the approve summary" UserLoginLabel = "Please select ssh user to login" NoPermission = "No permission,Please apply for permission" SelectServer = "Please select server for approve" SelectAction = "Please select action" BybLabel = "\n拜拜! 退出时间:%s\n" InfoLabel = `` /* 793-byte string literal not displayed */ )
Functions ¶
func FileNotExited ¶
FileNotExited FileNotExited
func GetServerSSHUsersMenu ¶
func GetServerSSHUsersMenu(server Server, matchPolicies []Policy) func(int, MenuItem, *ssh.Session, []MenuItem) []MenuItem
判断权限在这里实现
func GetServersMenuV2 ¶
func MultiValidate ¶
MultiValidate MultiValidate
Types ¶
type MenuItem ¶
type MenuItem struct {
Label string
Info map[string]string
IsShow func(index int, menuItem MenuItem, sess *ssh.Session, selectedChain []MenuItem) bool
SubMenuTitle string
GetSubMenu func(index int, menuItem MenuItem, sess *ssh.Session, selectedChain []MenuItem) []MenuItem
SelectedFunc func(index int, menuItem MenuItem, sess *ssh.Session, selectedChain []MenuItem) (bool, error)
NoSubMenuInfo string
BackAfterSelected bool
BackOptionLabel string
}
MenuItem menu item
func GetApproveMenu ¶
func GetApproveMenu(policies []*Policy) []MenuItem
type PUI ¶
type PUI struct {
// contains filtered or unexported fields
}
PUI pui
func (*PUI) SessionWrite ¶
Click to show internal directories.
Click to hide internal directories.