当前位置: 首页>>代码示例>>Golang>>正文


Golang web.Server类代码示例

本文整理汇总了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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:7,代码来源:monitoring_controller.go

示例2: NewLogController

func NewLogController(s *web.Server) *LogController {

	ctl := &LogController{}

	// 1 - Show log page
	s.GET("/logs", ctl.getLogsAction)

	return ctl
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:9,代码来源:log_controller.go

示例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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:12,代码来源:logfile_controller.go

示例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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:12,代码来源:configuration_controller.go

示例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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:21,代码来源:deployment_controller.go

示例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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:25,代码来源:application_controller.go

示例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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:18,代码来源:node_controller.go

示例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
}
开发者ID:KarhuTeam,项目名称:Karhu,代码行数:25,代码来源:alert_controller.go


注:本文中的github.com/karhuteam/karhu/web.Server类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。