Documentation ¶
Index ¶
- Variables
- func FileExited(filename string) func(string) error
- func FileNotExited(filename string) func(string) error
- func GetServerSSHUsersMenu(server config.Server, timeout string, matchPolicies []db.Policy) func(int, *MenuItem, *ssh.Session, []*MenuItem) []*MenuItem
- func IsDir() func(string) error
- func IsInt() func(string) error
- func IsNotDir() func(string) error
- func MatchServer(filter db.ServerFilter, server config.Server) bool
- 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
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 MatchServer ¶
func MatchServer(filter db.ServerFilter, server config.Server) bool
支持!开头的反向匹配 默认没有匹配到标签的允许访问
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
var (
ServerMenu *MenuItem
)
MainMenu main menu
func GetApproveMenu ¶
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.