Пример #1
0
func NewWebHttpView(ctl *ui.Controller, proto *proto.Http) *WebHttpView {
	w := &WebHttpView{
		ctl:          ctl,
		httpProto:    proto,
		idToTxn:      make(map[string]*WebHttpTxn),
		HttpRequests: util.NewRing(20),
	}
	go w.update()
	w.register()
	return w
}
Пример #2
0
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
}
Пример #3
0
Файл: http.go Проект: 40a/ngrok
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
}
Пример #4
0
func NewHttp(proto *proto.Http, shutdown chan int, x, y int) *HttpView {
	v := &HttpView{
		httpProto:    proto,
		HttpRequests: util.NewRing(size),
		area:         NewArea(x, y, 70, size+5),
		shutdown:     shutdown,
		Logger:       log.NewPrefixLogger(),
	}
	v.AddLogPrefix("view")
	v.AddLogPrefix("term")
	v.AddLogPrefix("http")
	go v.Run()
	return v
}
Пример #5
0
func NewWebHttpView(wv *WebView, ctl *ui.Controller, proto *proto.Http) *WebHttpView {
	w := &WebHttpView{
		webview:      wv,
		ctl:          ctl,
		httpProto:    proto,
		idToTxn:      make(map[string]*SerializedTxn),
		updates:      ctl.Updates.Reg(),
		state:        make(chan SerializedUiState),
		HttpRequests: util.NewRing(20),
	}
	go w.updateHttp()
	go w.updateUiState()
	w.register()
	return w
}