Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
karmanyaahm committed Dec 17, 2023
1 parent 0d607c7 commit ec79778
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions server/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ type subscriber func(v *visitor, msg *message) error
// newTopic creates a new topic
func newTopic(id string) *topic {
return &topic{
ID: id,
subscribers: make(map[int]*topicSubscriber),
lastAccess: time.Now(),
ID: id,
subscribers: make(map[int]*topicSubscriber),
lastAccess: time.Now(),
neverSubscribed: true,
}
}
Expand Down
12 changes: 6 additions & 6 deletions server/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (

// List of possible events
const (
openEvent = "open"
keepaliveEvent = "keepalive"
messageEvent = "message"
pollRequestEvent = "poll_request"
createdNewTopicParameter = "new_topic"
openEvent = "open"
openCreatedNewTopic = "new_topic"
keepaliveEvent = "keepalive"
messageEvent = "message"
pollRequestEvent = "poll_request"
)

const (
Expand Down Expand Up @@ -127,7 +127,7 @@ func newMessage(event, topic, msg string) *message {
func newOpenMessage(topic string, createdNewTopics bool) *message {
msg := ""
if createdNewTopics { // can expand this to a comma seperated string for more future parameters
msg = createdNewTopicParameter
msg = openCreatedNewTopic
}
return newMessage(openEvent, topic, msg)
}
Expand Down

0 comments on commit ec79778

Please sign in to comment.