Skip to content

Conversation

notzippy
Copy link
Collaborator

@notzippy notzippy commented May 4, 2017

Minimum changes for server engine to work

@notzippy notzippy modified the milestones: v0.17, v0.16 May 31, 2017
# Conflicts:
#	binder.go
#	binder_test.go
#	http.go
#	params.go
#	results.go
#	revel.go
#	template.go
#	validation.go
@notzippy notzippy added status-doing Implementation has started and removed waffle: needs review labels Jun 8, 2017
@notzippy notzippy added waffle: needs review and removed status-doing Implementation has started labels Jun 10, 2017
controller.go Outdated
@@ -24,7 +24,7 @@ type Controller struct {
Type *ControllerType // A description of the controller type.
MethodName string // The method name, e.g. "Index"
MethodType *MethodType // A description of the invoked action type.
AppController interface{} // The controller that was instantiated.
AppController interface{} // The controller that was instantiated. extends from revel.Controller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extends to embeds

compress.go Outdated
return
}

// This class will not send content out until the Released is called, from that point on it will act normally
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wording. This class to BufferedServerHeader per godoc conventions and also, it's a struct not a class

http.go Outdated
"sort"
"strconv"
"strings"

"golang.org/x/net/websocket"
"mime/multipart"
"path/filepath"
)

// Request Revel's HTTP request object structure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request is

http.go Outdated
"path/filepath"
)

// Request Revel's HTTP request object structure
type Request struct {
*http.Request
In ServerRequest
Header *RevelHeader
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServerHeader?

http.go Outdated
ContentType string
Format string // "html", "xml", "json", or "txt"
AcceptLanguages AcceptLanguages
Locale string
Websocket *websocket.Conn
Websocket ServerWebSocket
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebSocket

ENGINE_RESPONSE
)
const (
/* HTTP Engine Type Values Starts at 1000 */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 1000?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That gives room for the Minimum Engine constants listed before this block

@@ -0,0 +1,416 @@
package revel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serveradaptergo.go?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is already a file called template_agapter_go.go so this is consistent with that

simplestack.go Outdated

ss.Current = current

//nc := *current
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup?

Addr: ":9001",
}
if revel.CurrentEngine == nil {
revel.InitServerEngine(9001, revel.GO_NATIVE_SERVER_ENGINE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 9001?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what it was set to before

watcher.go Outdated
@@ -56,6 +56,7 @@ func (w *Watcher) Listen(listener Listener, roots ...string) {
// Otherwise multiple change events only come out one at a time, across
// multiple page views. (There appears no way to "pump" the events out of
// the watcher)
// This causes a notification when you do a check in GOLang, since you are modifying a buffer in use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wording and golang?

@notzippy
Copy link
Collaborator Author

notzippy commented Jul 6, 2017

Note the build will fail because revel/cmd needs the changes merged as well

compress.go Outdated
compressionType: compressType,
headersWritten: false,
closeNotify: make(chan bool, 1),
closed: false}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add , and put } on new line?

notzippy added 2 commits July 9, 2017 10:10
# Conflicts:
#	controller.go
#	fakeapp_test.go
#	revel.go
#	router.go
#	server.go
@notzippy notzippy modified the milestones: v0.18, v0.17 Jul 12, 2017
…nstead of by key, this allows for a headers case insensitive fetch
@notzippy notzippy merged commit fbcad28 into revel:develop Jul 24, 2017
@arvenil
Copy link

arvenil commented Apr 19, 2018

@notzippy How from revel.ServerWebSocket I can access *websocket.Conn?

@notzippy
Copy link
Collaborator Author

@arvenil

In the Go server engine the ServerWebSocket is implemented by the structure *GoWebSocket inside that structure the native Conn *websocket.Conn lives. In code you can implement this like


func (a *App) EndPoint(ws *revel.ServerWebSocket) {
 // realWs is "golang.org/x/net/websocket"
 realWs := ws.(*revel.GoWebSocket).Conn
// Your code
return a.Render()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants