func main() { defer func() { err := easy_error.Apply(recover()) if err != nil { fmt.Println(err) os.Exit(2) } }() flag.Parse() server := easy_error.Wrap(tomcat_info.ReadServer(*serverdir)).(*tomcat_info.Server) tomcatusers := easy_error.Wrap(server.ReadTomcatUsers()).(*tomcat_info.TomcatUsers) usermap := tomcatusers.GetUsersWithRole("manager") manager, ok := usermap["manager"] if ok { fmt.Println(manager.Password) return } else { for _, v := range usermap { fmt.Println(v.Password) return } } fmt.Println("No manager user exists") os.Exit(1) }
func main() { defer func() { err := easy_error.Apply(recover()) if err != nil { fmt.Println(err) os.Exit(1) } }() flag.Parse() server := easy_error.Wrap(tomcat_info.ReadServer(*serverdir)).(*tomcat_info.Server) port := easy_error.Wrap(server.GetHttpPort()).(int16) fmt.Println(port) }
func doGetServerPort() { server := easy_error.Wrap(tomcat_info.ReadServer(*serverdir)).(*tomcat_info.Server) port := easy_error.Wrap(server.GetHttpPort()).(uint16) fmt.Println(port) }
func getServer() *tomcat_info.Server { if server == nil { server = easy_error.Wrap(tomcat_info.ReadServer(*serverdir)).(*tomcat_info.Server) } return server }