Skip to content

Commit

Permalink
improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannm committed May 4, 2023
1 parent d801080 commit c4bbbb9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ to manage dependencies. The version of Go should be **1.17** or above.
```sh
$ git clone https://github.com/$GITHUB_USER/ronykit
$ cd ronykit
$ git remote add upstream [email protected]:clubpay/kit.git
$ git remote add upstream [email protected]:clubpay/ronykit.git

# Never push to the upstream master
git remote set-url --push upstream no_push
Expand Down
4 changes: 2 additions & 2 deletions kit/stub/stub_rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (hc *RESTCtx) Error() error {
// StatusCode returns the status code of the response
func (hc *RESTCtx) StatusCode() int { return hc.res.StatusCode() }

// GetHeader returns the header value for key in the response
// GetHeader returns the header value for the key in the response
func (hc *RESTCtx) GetHeader(key string) string {
return string(hc.res.Header.Peek(key))
}
Expand All @@ -190,7 +190,7 @@ func (hc *RESTCtx) CopyBody(dst []byte) []byte {
return dst
}

// Release frees the allocates internal resources to be re-used.
// Release frees the allocated internal resources to be re-used.
// You MUST NOT refer to any method of this object after calling this method, if
// you call any method after Release has been called, the result is unpredictable.
func (hc *RESTCtx) Release() {
Expand Down
15 changes: 11 additions & 4 deletions kit/stub/stub_ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,19 @@ func (wCtx *WebsocketCtx) NetConn() net.Conn {
}

type WebsocketRequest struct {
Predicate string
// Predicate is the routing key for the message, which will be added to the kit.OutgoingRPCContainer
Predicate string
// MessageType is the type of the message, either websocket.TextMessage or websocket.BinaryMessage
MessageType int
ReqMsg kit.Message
ResMsg kit.Message
ReqHdr Header
Callback RPCMessageHandler
// ResMsg is the message that will be used to unmarshal the response.
// You should pass a pointer to the struct that you want to unmarshal the response into.
ResMsg kit.Message
// ReqHdr is the headers that will be added to the kit.OutgoingRPCContainer
ReqHdr Header
// Callback is the callback that will be called when the response is received.
// This MUST BE non-nil otherwise it panics.
Callback RPCMessageHandler
}

func (wCtx *WebsocketCtx) Do(ctx context.Context, req WebsocketRequest) error {
Expand Down

0 comments on commit c4bbbb9

Please sign in to comment.