Skip to content

Commit

Permalink
Fix typos in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaxmax committed Nov 19, 2023
1 parent 2ccff40 commit 04f3693
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ If the server doesn't set a retry time, the client's `DefaultReconnectionTime` i

### The "Hello world" server's client

Let's use what we know to create a client for the prevoius server example:
Let's use what we know to create a client for the previous server example:

```go
package main
Expand Down
6 changes: 3 additions & 3 deletions client_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Event struct {
LastEventID string
// The event's type. It is empty if the event is unnamed.
Type string
// The events's payload.
// The event's payload.
Data string
}

Expand Down Expand Up @@ -51,7 +51,7 @@ type Connection struct { //nolint:govet // The current order aids readability.
isRetry bool
}

// SubscribeMessages subscribes the given callback to all events without type (without or with empty `event field).
// SubscribeMessages subscribes the given callback to all events without type (without or with empty `event` field).
// Remove the callback by calling the returned function.
func (c *Connection) SubscribeMessages(cb EventCallback) EventCallbackRemover {
return c.SubscribeEvent("", cb)
Expand All @@ -64,7 +64,7 @@ func (c *Connection) SubscribeEvent(typ string, cb EventCallback) EventCallbackR
return c.addSubscriber(typ, cb)
}

// SubscribeToAll subscribes the given callbcak to all events, with or without type.
// SubscribeToAll subscribes the given callback to all events, with or without type.
// Remove the callback by calling the returned function.
func (c *Connection) SubscribeToAll(cb EventCallback) EventCallbackRemover {
return c.addSubscriberToAll(cb)
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type Server struct {
// The provider used to publish and subscribe clients to events.
// Defaults to Joe.
Provider Provider
// A callback that's called when a SSE session is started.
// A callback that's called when an SSE session is started.
// You can use this to authorize the session, set the topics
// the client should be subscribed to and so on. Using the
// Res field of the Session you can write an error response
Expand Down
6 changes: 3 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type MessageWriter interface {
Flush() error
}

// A Session is a HTTP request from a SSE client.
// A Session is an HTTP request from an SSE client.
// Create one using the Upgrade function.
//
// Using a Session you can also access the initial HTTP request,
Expand All @@ -33,7 +33,7 @@ type Session struct {
// The initial HTTP request. Can be used to retrieve authentication data,
// topics, or data from context – a logger, for example.
Req *http.Request
// Last evend ID of the client. It is unset if no ID was provided in the Last-Event-Id
// Last event ID of the client. It is unset if no ID was provided in the Last-Event-Id
// request header.
LastEventID EventID

Expand Down Expand Up @@ -74,7 +74,7 @@ func (s *Session) doUpgrade() error {
return nil
}

// Upgrade upgrades a HTTP request to support server-sent events.
// Upgrade upgrades an HTTP request to support server-sent events.
// It returns a Session that's used to send events to the client, or an
// error if the upgrade failed.
//
Expand Down

0 comments on commit 04f3693

Please sign in to comment.