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


Golang mango.Stack類代碼示例

本文整理匯總了Golang中mango.Stack的典型用法代碼示例。如果您正苦於以下問題:Golang Stack類的具體用法?Golang Stack怎麽用?Golang Stack使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: main

func main() {
	stack := new(mango.Stack)
	stack.Address = ":3000"
	custom_logger := log.New(os.Stdout, "", log.Ldate|log.Ltime)
	stack.Middleware(mango.Logger(custom_logger))
	stack.Run(Hello)
}
開發者ID:qrush,項目名稱:higo,代碼行數:7,代碼來源:logger.go

示例2: main

func main() {
	stack := new(mango.Stack)
	stack.Address = ":3000"

	stack.Middleware(silence.SilenceErrors) // Include our custom middleware

	stack.Run(Hello)
}
開發者ID:victorcoder,項目名稱:mango,代碼行數:8,代碼來源:silence.go

示例3: main

func main() {
	routes := make(map[string]mango.App)
	routes["/"] = new(mango.Stack).Compile(Index)
	routes["/get_token"] = new(mango.Stack).Compile(GetToken)

	stack := new(mango.Stack)
	stack.Middleware(mango.ShowErrors("<html><body>{Error|html}</body></html>"), mango.Routing(routes))
	stack.Address = ":3001"
	stack.Run(Index)
}
開發者ID:flavioribeiro,項目名稱:stewie-go,代碼行數:10,代碼來源:app.go

示例4: main

func main() {
	stack := new(mango.Stack)
	stack.Address = ":3000"

	// Route all requests for /goodbye to the Goodbye handler
	routes := map[string]mango.App{"/goodbye(.*)": Goodbye}
	stack.Middleware(mango.Routing(routes))

	// Hello handles all requests not sent to Goodbye
	stack.Run(Hello)
}
開發者ID:victorcoder,項目名稱:mango,代碼行數:11,代碼來源:routing.go

示例5: main

func main() {

	stack := new(mango.Stack)
	stack.Address = ":3000"

	// Initialize our cats middleware with our list of cat_images
	cat_images := []string{"http://images.cheezburger.com/completestore/2010/7/4/9440dc57-52a6-4122-9ab3-efd4daa0ff60.jpg", "http://images.icanhascheezburger.com/completestore/2008/12/10/128733944185267668.jpg"}
	cats_middleware := cats.Cats(cat_images)

	stack.Middleware(cats_middleware) // Include the Cats middleware in our stack

	stack.Run(Hello)
}
開發者ID:victorcoder,項目名稱:mango,代碼行數:13,代碼來源:cats.go

示例6: main

func main() {

	// redis hello world
	c, err := redis.Dial("tcp", ":6379")
	if err != nil {
		// handle error
	} else {
		fmt.Println("Hello, 世界")
	}
	c.Do("SET", "k1", 1)
	defer c.Close()

	ci := make(chan int, 10)
	go ProbeManager(ci)

	t1 := Probe{}
	fmt.Println("Rectangle r1 is: ", t1)
	stack := new(mango.Stack)
	stack.Address = ":3000"
	stack.Middleware(mango.ShowErrors(""))
	stack.Run(Hello)
}
開發者ID:aleksclark,項目名稱:vigia,代碼行數:22,代碼來源:vigia.go

示例7: main

func main() {
	stack := new(mango.Stack)
	stack.Address = ":3000"
	stack.Middleware(mango.Sessions("my_secret", "my_session_key", ".my.domain.com"))
	stack.Run(Hello)
}
開發者ID:victorcoder,項目名稱:mango,代碼行數:6,代碼來源:session.go

示例8: main

func main() {
	stack := new(mango.Stack)
	stack.Address = ":3000"
	stack.Run(Hello)
}
開發者ID:victorcoder,項目名稱:mango,代碼行數:5,代碼來源:hello.go


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