本文整理匯總了Golang中ngrok/client/mvc.Controller類的典型用法代碼示例。如果您正苦於以下問題:Golang Controller類的具體用法?Golang Controller怎麽用?Golang Controller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Controller類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newTermHttpView
func newTermHttpView(ctl mvc.Controller, termView *TermView, proto *proto.Http, x, y int) *HttpView {
v := &HttpView{
httpProto: proto,
HttpRequests: util.NewRing(size),
area: NewArea(x, y, 70, size+5),
shutdown: make(chan int),
termView: termView,
Logger: log.NewPrefixLogger("view", "term", "http"),
}
ctl.Go(v.Run)
return v
}
示例2: newWebHttpView
func newWebHttpView(ctl mvc.Controller, wv *WebView, proto *proto.Http) *WebHttpView {
whv := &WebHttpView{
Logger: log.NewPrefixLogger("view", "web", "http"),
webview: wv,
ctl: ctl,
httpProto: proto,
idToTxn: make(map[string]*SerializedTxn),
HttpRequests: util.NewRing(20),
}
ctl.Go(whv.updateHttp)
whv.register()
return whv
}
示例3: NewTermView
func NewTermView(ctl mvc.Controller) *TermView {
// initialize terminal display
termbox.Init()
w, _ := termbox.Size()
v := &TermView{
ctl: ctl,
updates: ctl.Updates().Reg(),
redraw: util.NewBroadcast(),
flush: make(chan int),
shutdown: make(chan int),
Logger: log.NewPrefixLogger("view", "term"),
area: NewArea(0, 0, w, 10),
}
ctl.Go(v.run)
ctl.Go(v.input)
return v
}