當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Session.RenderWithLayout方法代碼示例

本文整理匯總了Golang中github.com/ian-kent/gotcha/http.Session.RenderWithLayout方法的典型用法代碼示例。如果您正苦於以下問題:Golang Session.RenderWithLayout方法的具體用法?Golang Session.RenderWithLayout怎麽用?Golang Session.RenderWithLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/ian-kent/gotcha/http.Session的用法示例。


在下文中一共展示了Session.RenderWithLayout方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: show_log

func show_log(session *http.Session) {
	session.Stash["Title"] = "websysd log"
	session.Stash["Page"] = "AppLog"
	session.Stash["LogOutput"] = applog.String()

	session.RenderWithLayout("applog.html", "layout.html", "Content")
}
開發者ID:golang-devops,項目名稱:websysd,代碼行數:7,代碼來源:main.go

示例2: list_workspaces

func list_workspaces(session *http.Session) {
	// Stash a value and render a template
	session.Stash["Title"] = "websysd"
	session.Stash["Page"] = "Workspaces"
	session.Stash["Workspaces"] = Workspaces
	session.RenderWithLayout("workspaces.html", "layout.html", "Content")
}
開發者ID:golang-devops,項目名稱:websysd,代碼行數:7,代碼來源:main.go

示例3: list_tasks

func list_tasks(session *http.Session) {
	ws, _ := session.Stash["workspace"].(string)

	// Stash a value and render a template
	session.Stash["Title"] = "websysd"
	session.Stash["Page"] = "Tasks"
	session.Stash["Workspace"] = Workspaces[ws]
	session.Stash["Tasks"] = Workspaces[ws].Tasks
	session.RenderWithLayout("tasks.html", "layout.html", "Content")
}
開發者ID:golang-devops,項目名稱:websysd,代碼行數:10,代碼來源:main.go

示例4: taskHistory

func taskHistory(session *http.Session) {
	ws, _ := session.Stash["workspace"].(string)
	id, _ := session.Stash["task"].(string)

	session.Stash["Title"] = "Task"
	session.Stash["Page"] = "History"
	session.Stash["Workspace"] = Workspaces[ws]
	session.Stash["Task"] = Workspaces[ws].Tasks[id]

	session.RenderWithLayout("task.html", "layout.html", "Content")
}
開發者ID:golang-devops,項目名稱:websysd,代碼行數:11,代碼來源:main.go

示例5: taskRun

func taskRun(session *http.Session) {
	ws, _ := session.Stash["workspace"].(string)
	id, _ := session.Stash["task"].(string)
	run, _ := strconv.Atoi(session.Stash["run"].(string))

	session.Stash["Title"] = "Task run"
	session.Stash["Page"] = "TaskRun"
	session.Stash["Workspace"] = Workspaces[ws]
	session.Stash["Task"] = Workspaces[ws].Tasks[id]
	session.Stash["TaskRun"] = Workspaces[ws].Tasks[id].TaskRuns[run]

	session.RenderWithLayout("taskrun.html", "layout.html", "Content")
}
開發者ID:golang-devops,項目名稱:websysd,代碼行數:13,代碼來源:main.go

示例6: taskRunStderr

func taskRunStderr(session *http.Session) {
	ws, _ := session.Stash["workspace"].(string)
	id, _ := session.Stash["task"].(string)
	run, _ := strconv.Atoi(session.Stash["run"].(string))

	session.Stash["Title"] = "Task run stderr"
	session.Stash["Page"] = "TaskOutput"
	session.Stash["Type"] = "stderr"
	session.Stash["Workspace"] = Workspaces[ws]
	session.Stash["Task"] = Workspaces[ws].Tasks[id]
	session.Stash["TaskRun"] = Workspaces[ws].Tasks[id].TaskRuns[run]
	session.Stash["LogOutput"] = Workspaces[ws].Tasks[id].TaskRuns[run].StderrBuf.String()

	session.RenderWithLayout("log.html", "layout.html", "Content")
}
開發者ID:golang-devops,項目名稱:websysd,代碼行數:15,代碼來源:main.go


注:本文中的github.com/ian-kent/gotcha/http.Session.RenderWithLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。