Skip to content

Commit c4bbbb9

Browse files
committed
improve comments
1 parent d801080 commit c4bbbb9

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ to manage dependencies. The version of Go should be **1.17** or above.
4343
```sh
4444
$ git clone https://github.com/$GITHUB_USER/ronykit
4545
$ cd ronykit
46-
$ git remote add upstream git@github.com:clubpay/kit.git
46+
$ git remote add upstream git@github.com:clubpay/ronykit.git
4747

4848
# Never push to the upstream master
4949
git remote set-url --push upstream no_push

kit/stub/stub_rest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (hc *RESTCtx) Error() error {
163163
// StatusCode returns the status code of the response
164164
func (hc *RESTCtx) StatusCode() int { return hc.res.StatusCode() }
165165

166-
// GetHeader returns the header value for key in the response
166+
// GetHeader returns the header value for the key in the response
167167
func (hc *RESTCtx) GetHeader(key string) string {
168168
return string(hc.res.Header.Peek(key))
169169
}
@@ -190,7 +190,7 @@ func (hc *RESTCtx) CopyBody(dst []byte) []byte {
190190
return dst
191191
}
192192

193-
// Release frees the allocates internal resources to be re-used.
193+
// Release frees the allocated internal resources to be re-used.
194194
// You MUST NOT refer to any method of this object after calling this method, if
195195
// you call any method after Release has been called, the result is unpredictable.
196196
func (hc *RESTCtx) Release() {

kit/stub/stub_ws.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,19 @@ func (wCtx *WebsocketCtx) NetConn() net.Conn {
250250
}
251251

252252
type WebsocketRequest struct {
253-
Predicate string
253+
// Predicate is the routing key for the message, which will be added to the kit.OutgoingRPCContainer
254+
Predicate string
255+
// MessageType is the type of the message, either websocket.TextMessage or websocket.BinaryMessage
254256
MessageType int
255257
ReqMsg kit.Message
256-
ResMsg kit.Message
257-
ReqHdr Header
258-
Callback RPCMessageHandler
258+
// ResMsg is the message that will be used to unmarshal the response.
259+
// You should pass a pointer to the struct that you want to unmarshal the response into.
260+
ResMsg kit.Message
261+
// ReqHdr is the headers that will be added to the kit.OutgoingRPCContainer
262+
ReqHdr Header
263+
// Callback is the callback that will be called when the response is received.
264+
// This MUST BE non-nil otherwise it panics.
265+
Callback RPCMessageHandler
259266
}
260267

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

0 commit comments

Comments
 (0)