diff --git a/app/webhooks.go b/app/webhooks.go index 2bb41f6..35d9e7c 100644 --- a/app/webhooks.go +++ b/app/webhooks.go @@ -74,7 +74,7 @@ func newClientHook(channel *channel.Channel, s *subscription.Subscription, event return hookEvent{Name: "client_event", Channel: channel.ID, Event: event, Data: data, SocketID: s.Connection.SocketID} } -// channel_occupied +// TriggerChannelOccupiedHook channel_occupied // { "name": "channel_occupied", "channel": "test_channel" } func (a *Application) TriggerChannelOccupiedHook(c *channel.Channel) { event := newChannelOcuppiedHook(c) diff --git a/channel/channel.go b/channel/channel.go index bbf2380..75e8553 100644 --- a/channel/channel.go +++ b/channel/channel.go @@ -27,7 +27,7 @@ type ListenerFunc func(*Channel, *subscription.Subscription) // ClientEventListenerFunc listener for client events type ClientEventListenerFunc func(*Channel, *subscription.Subscription, string, interface{}) -// A Channel +// Channel represents an application channel type Channel struct { sync.RWMutex @@ -43,7 +43,7 @@ type Channel struct { clientEventListeners []ClientEventListenerFunc } -// Create a new Channel +// New Create a new Channel func New(channelID string, options ...Option) *Channel { log.Infof("Creating a new Channel: %s", channelID) diff --git a/events/events.go b/events/events.go index c936dba..f38c661 100644 --- a/events/events.go +++ b/events/events.go @@ -39,7 +39,7 @@ func NewSubscribe(channel, auth, channelData string) Subscribe { return Subscribe{Event: "pusher:subscribe", Data: data} } -// UnsubscribeData +// UnsubscribeData event data type UnsubscribeData struct { Channel string `json:"channel"` } @@ -56,7 +56,7 @@ type Unsubscribe struct { Data UnsubscribeData `json:"data"` } -// Create a new unsubscribe event for the specified channel +// NewUnsubscribe Create a new unsubscribe event for the specified channel func NewUnsubscribe(channel string) Unsubscribe { data := UnsubscribeData{Channel: channel} return Unsubscribe{Event: "pusher:unsubscribe", Data: data} @@ -73,7 +73,7 @@ type SubscriptionSucceeded struct { Data string `json:"data"` } -// Create a new subscription succeed event for the specified channel +// NewSubscriptionSucceeded Create a new subscription succeed event for the specified channel func NewSubscriptionSucceeded(channel, data string) SubscriptionSucceeded { return SubscriptionSucceeded{Event: "pusher_internal:subscription_succeeded", Channel: channel, Data: data} } diff --git a/storage/storage.go b/storage/storage.go index 56c7f13..7f94936 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -10,7 +10,7 @@ import ( "sync" ) -// storage represents a app database +// Storage represents a app database // For now it there is only one memory database implementation // but in the future I can write a sql implementation type Storage interface {