本文整理匯總了Golang中github.com/karhuteam/karhu/web.Server類的典型用法代碼示例。如果您正苦於以下問題:Golang Server類的具體用法?Golang Server怎麽用?Golang Server使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Server類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewMonitoringController
func NewMonitoringController(s *web.Server) *MonitoringController {
ctl := &MonitoringController{}
s.GET("/monitoring", ctl.getMonitoringAction)
return ctl
}
示例2: NewLogController
func NewLogController(s *web.Server) *LogController {
ctl := &LogController{}
// 1 - Show log page
s.GET("/logs", ctl.getLogsAction)
return ctl
}
示例3: NewLogfileController
func NewLogfileController(s *web.Server) *LogfileController {
ctl := &LogfileController{}
// 1 - Add a logfile
s.GET("/application/logfile/:app_id", ctl.getAddLogfileAction)
s.POST("/application/logfile/:app_id", ctl.postAddLogfileAction)
s.GET("/application/logfile/:app_id/:logfile_id", ctl.getEditLogfileAction)
s.POST("/application/logfile/:app_id/:logfile_id", ctl.postEditLogfileAction)
return ctl
}
示例4: NewConfigurationController
func NewConfigurationController(s *web.Server) *ConfigurationController {
ctl := &ConfigurationController{}
// 1 - Add a configuration
s.GET("/application/configuration/:app_id", ctl.getAddConfigurationAction)
s.POST("/application/configuration/:app_id", ctl.postAddConfigurationAction)
s.GET("/application/configuration/:app_id/:config_id", ctl.getEditConfigurationAction)
s.POST("/application/configuration/:app_id/:config_id", ctl.postEditConfigurationAction)
return ctl
}
示例5: NewDeploymentController
func NewDeploymentController(s *web.Server) *DeploymentController {
ctl := &DeploymentController{
upgrader: websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
CheckOrigin: func(r *http.Request) bool {
return true
},
},
}
// 1 - Show deployment
s.GET("/application/deployment/:app_id/:deploy_id", ctl.getDeploymentAction)
// 2 - Create a deployment
s.POST("/application/deployment/:app_id/:build_id", ctl.postDeploymentAction)
// 3 - Stream the output (ws)
s.GET("/ws/application/deployment/:app_id/:deploy_id", ctl.getDeploymentWSAction)
return ctl
}
示例6: NewApplicationController
func NewApplicationController(s *web.Server) *ApplicationController {
ctl := &ApplicationController{}
// 1 - Applications list
s.GET("/", ctl.getApplicationsAction)
// 2 - Show an application
s.GET("/application/show/:id", ctl.getApplicationAction)
// 3 - Add an application
s.GET("/application/add", ctl.getAddApplicationAction)
s.POST("/application/add", ctl.postAddApplicationAction)
// Add an application - service
s.GET("/application/add/service", ctl.getAddApplicationServiceAction)
s.POST("/application/add/service", ctl.postAddApplicationServiceAction)
// Add an application - docker
s.GET("/application/add/docker", ctl.getAddApplicationDockerAction)
s.POST("/application/add/docker", ctl.postAddApplicationDockerAction)
// 4 - Edit an application
s.GET("/application/edit/:id", ctl.getEditApplicationAction)
s.POST("/application/edit/:id", ctl.postEditApplicationAction)
// 5 - Delete an application
s.GET("/application/delete/:id", ctl.getDeleteApplicationAction)
return ctl
}
示例7: NewNodeController
func NewNodeController(s *web.Server) *NodeController {
ctl := &NodeController{}
s.GET("/nodes", ctl.getNodesAction)
s.GET("/node/edit/:id", ctl.getNodeAction)
s.POST("/node/edit/:id", ctl.postNodeAction)
s.GET("/node/add", ctl.getNodeAddAction)
s.GET("/node/add/ec2", ctl.getNodeAddEc2Action)
s.POST("/node/add/ec2", ctl.postNodeAddEc2Action)
s.GET("/node/add/do", ctl.getNodeAddDOAction)
s.POST("/node/add/do", ctl.postNodeAddDOAction)
s.POST("/node/access/add", ctl.postAddAccessAction)
s.POST("/node/access/delete/:type", ctl.postDeleteAccessAction)
s.POST("/node/delete/:id", ctl.postDeleteNodeAction)
return ctl
}
示例8: NewAlertController
func NewAlertController(s *web.Server) *AlertController {
ctl := &AlertController{}
s.GET("/alerts", ctl.getAlertsListAction)
s.POST("/alerts/acknowledge/:id", ctl.postAlertsAcknowledgeAction)
s.POST("/alerts/close/:id", ctl.postAlertsCloseAction)
s.POST("/alerts/message/:id", ctl.postAlertsMessageAction)
s.GET("/alerts-policies", ctl.getAlertsPolicyListAction)
s.GET("/alerts-policies/add", ctl.getAddAlertsPolicyAction)
s.POST("/alerts-policies/add", ctl.postAddAlertsPolicyAction)
s.GET("/alerts-policies/edit/:id", ctl.getEditAlertsPolicyAction)
s.POST("/alerts-policies/edit/:id", ctl.postEditAlertsPolicyAction)
s.POST("/alerts-policies/delete/:id", ctl.postDeleteAlertsPolicyAction)
s.GET("/alerts-groups", ctl.getAlertsGroupsListAction)
s.GET("/alerts-groups/add", ctl.getAddAlertsGroupAction)
s.POST("/alerts-groups/add", ctl.postAddAlertsGroupAction)
s.GET("/alerts-groups/edit/:id", ctl.getEditAlertsGroupAction)
s.POST("/alerts-groups/edit/:id", ctl.postEditAlertsGroupAction)
s.POST("/alerts-groups/delete/:id", ctl.postDeleteAlertsGroupAction)
return ctl
}