Documentation ¶
Index ¶
- Constants
- func NewHTTP1Client(connectTimeout, responseReadTimeout, maxIdleConnsPerHost int) *http.Client
- func NewHTTP2Client(connectTimeout int, responseReadTimeout int) *http.Client
- func SetQueryParam(q *url.Values, queryParam map[string]string)
- type AddChannelToChannelGroupResponse
- type AddPushNotificationsOnChannelsResponse
- type AllChannelGroupResponse
- type Config
- type Context
- type DeleteChannelGroupResponse
- type FetchResponse
- type FetchResponseItem
- type GetStateResponse
- type GrantResponse
- type HeartbeatManager
- type HereNowChannelData
- type HereNowOccupantsData
- type HereNowResponse
- type HistoryDeleteResponse
- type HistoryResponse
- type HistoryResponseItem
- type JobQItem
- type JobQResponse
- type LatencyEntry
- type ListPushProvisionsRequestResponse
- type Listener
- type ListenerManager
- type OperationType
- type Operations
- type PNAccessManagerKeyData
- type PNGrantType
- type PNMessage
- type PNPAMEntityData
- type PNPresence
- type PNPushType
- type PNStatus
- type PubNub
- func (pn *PubNub) AddChannelToChannelGroup() *addChannelToChannelGroupBuilder
- func (pn *PubNub) AddChannelToChannelGroupWithContext(ctx Context) *addChannelToChannelGroupBuilder
- func (pn *PubNub) AddListener(listener *Listener)
- func (pn *PubNub) AddPushNotificationsOnChannels() *addPushNotificationsOnChannelsBuilder
- func (pn *PubNub) AddPushNotificationsOnChannelsWithContext(ctx Context) *addPushNotificationsOnChannelsBuilder
- func (pn *PubNub) DeleteChannelGroup() *deleteChannelGroupBuilder
- func (pn *PubNub) DeleteChannelGroupWithContext(ctx Context) *deleteChannelGroupBuilder
- func (pn *PubNub) DeleteMessages() *historyDeleteBuilder
- func (pn *PubNub) DeleteMessagesWithContext(ctx Context) *historyDeleteBuilder
- func (pn *PubNub) Destroy()
- func (pn *PubNub) Fetch() *fetchBuilder
- func (pn *PubNub) FetchWithContext(ctx Context) *fetchBuilder
- func (pn *PubNub) Fire() *fireBuilder
- func (pn *PubNub) FireWithContext(ctx Context) *fireBuilder
- func (pn *PubNub) GetClient() *http.Client
- func (pn *PubNub) GetListeners() map[*Listener]bool
- func (pn *PubNub) GetState() *getStateBuilder
- func (pn *PubNub) GetStateWithContext(ctx Context) *getStateBuilder
- func (pn *PubNub) GetSubscribeClient() *http.Client
- func (pn *PubNub) GetSubscribedChannels() []string
- func (pn *PubNub) GetSubscribedGroups() []string
- func (pn *PubNub) Grant() *grantBuilder
- func (pn *PubNub) GrantWithContext(ctx Context) *grantBuilder
- func (pn *PubNub) HereNow() *hereNowBuilder
- func (pn *PubNub) HereNowWithContext(ctx Context) *hereNowBuilder
- func (pn *PubNub) History() *historyBuilder
- func (pn *PubNub) HistoryWithContext(ctx Context) *historyBuilder
- func (pn *PubNub) Leave() *leaveBuilder
- func (pn *PubNub) LeaveWithContext(ctx Context) *leaveBuilder
- func (pn *PubNub) ListChannelsInChannelGroup() *allChannelGroupBuilder
- func (pn *PubNub) ListChannelsInChannelGroupWithContext(ctx Context) *allChannelGroupBuilder
- func (pn *PubNub) ListPushProvisions() *listPushProvisionsRequestBuilder
- func (pn *PubNub) ListPushProvisionsWithContext(ctx Context) *listPushProvisionsRequestBuilder
- func (pn *PubNub) Presence() *presenceBuilder
- func (pn *PubNub) PresenceWithContext(ctx Context) *presenceBuilder
- func (pn *PubNub) Publish() *publishBuilder
- func (pn *PubNub) PublishWithContext(ctx Context) *publishBuilder
- func (pn *PubNub) RemoveAllPushNotifications() *removeAllPushChannelsForDeviceBuilder
- func (pn *PubNub) RemoveAllPushNotificationsWithContext(ctx Context) *removeAllPushChannelsForDeviceBuilder
- func (pn *PubNub) RemoveChannelFromChannelGroup() *removeChannelFromChannelGroupBuilder
- func (pn *PubNub) RemoveChannelFromChannelGroupWithContext(ctx Context) *removeChannelFromChannelGroupBuilder
- func (pn *PubNub) RemoveListener(listener *Listener)
- func (pn *PubNub) RemovePushNotificationsFromChannels() *removeChannelsFromPushBuilder
- func (pn *PubNub) RemovePushNotificationsFromChannelsWithContext(ctx Context) *removeChannelsFromPushBuilder
- func (pn *PubNub) SetClient(c *http.Client)
- func (pn *PubNub) SetState() *setStateBuilder
- func (pn *PubNub) SetStateWithContext(ctx Context) *setStateBuilder
- func (pn *PubNub) SetSubscribeClient(client *http.Client)
- func (pn *PubNub) Subscribe() *subscribeBuilder
- func (pn *PubNub) Time() *timeBuilder
- func (pn *PubNub) TimeWithContext(ctx Context) *timeBuilder
- func (pn *PubNub) Unsubscribe() *unsubscribeBuilder
- func (pn *PubNub) UnsubscribeAll()
- func (pn *PubNub) WhereNow() *whereNowBuilder
- func (pn *PubNub) WhereNowWithContext(ctx Context) *whereNowBuilder
- type PublishResponse
- type ReconnectionManager
- type ReconnectionPolicy
- type RemoveAllPushChannelsForDeviceResponse
- type RemoveChannelFromChannelGroupResponse
- type RemoveChannelsFromPushResponse
- type RequestWorkers
- type ResponseInfo
- type SetStateResponse
- type StateManager
- type StateOperation
- type StatusCategory
- type StatusResponse
- type SubscribeOperation
- type SubscriptionItem
- type SubscriptionManager
- func (m *SubscriptionManager) AddListener(listener *Listener)
- func (m *SubscriptionManager) Destroy()
- func (m *SubscriptionManager) Disconnect()
- func (m *SubscriptionManager) GetListeners() map[*Listener]bool
- func (m *SubscriptionManager) RemoveAllListeners()
- func (m *SubscriptionManager) RemoveListener(listener *Listener)
- type TelemetryManager
- type TimeResponse
- type UnsubscribeOperation
- type WhereNowResponse
- type Worker
Constants ¶
const ( // Version :the version of the SDK Version = "4.1.6" // MaxSequence for publish messages MaxSequence = 65535 )
Default constants
const ( // StrMissingPubKey show Missing Publish Key message StrMissingPubKey = "Missing Publish Key" // StrMissingSubKey show Missing Subscribe Key message StrMissingSubKey = "Missing Subscribe Key" // StrMissingChannel show Channel message StrMissingChannel = "Missing Channel" // StrMissingChannelGroup show Channel Group message StrMissingChannelGroup = "Missing Channel Group" // StrMissingMessage show Missing Message message StrMissingMessage = "Missing Message" // StrMissingSecretKey show Missing Secret Key message StrMissingSecretKey = "Missing Secret Key" // StrMissingUUID show Missing UUID message StrMissingUUID = "Missing UUID" // StrMissingDeviceID show Missing Device ID message StrMissingDeviceID = "Missing Device ID" // StrMissingPushType show Missing Push Type message StrMissingPushType = "Missing Push Type" )
Variables ¶
This section is empty.
Functions ¶
func NewHTTP1Client ¶
NewHTTP1Client creates a new HTTP 1 client with a new transport initialized with connect and read timeout
func NewHTTP2Client ¶
NewHTTP2Client creates a new HTTP 2 client with a new transport initialized with connect and read timeout
Types ¶
type AddChannelToChannelGroupResponse ¶
type AddChannelToChannelGroupResponse struct { }
AddChannelToChannelGroupResponse is the struct returned when the Execute function of AddChannelToChannelGroup is called.
type AddPushNotificationsOnChannelsResponse ¶
type AddPushNotificationsOnChannelsResponse struct{}
AddPushNotificationsOnChannelsResponse is response structure for AddPushNotificationsOnChannelsBuilder
type AllChannelGroupResponse ¶
AllChannelGroupResponse is the struct returned when the Execute function of List All Channel Groups is called.
type Config ¶
type Config struct { PublishKey string // PublishKey you can get it from admin panel (only required if publishing). SubscribeKey string // SubscribeKey you can get it from admin panel. SecretKey string // SecretKey (only required for modifying/revealing access permissions). AuthKey string // AuthKey If Access Manager is utilized, client will use this AuthKey in all restricted requests. Origin string // Custom Origin if needed UUID string // UUID to be used as a device identifier, a default uuid is generated if not passed. CipherKey string // If CipherKey is passed, all communications to/from PubNub will be encrypted. Secure bool // True to use TLS ConnectTimeout int // net.Dialer.Timeout NonSubscribeRequestTimeout int // http.Client.Timeout for non-subscribe requests SubscribeRequestTimeout int // http.Client.Timeout for subscribe requests only HeartbeatInterval int // The frequency of the pings to the server to state that the client is active PresenceTimeout int // The time after which the server will send a timeout for the client MaximumReconnectionRetries int // The config sets how many times to retry to reconnect before giving up. MaximumLatencyDataAge int // Max time to store the latency data for telemetry FilterExpression string // Feature to subscribe with a custom filter expression. PNReconnectionPolicy ReconnectionPolicy // Reconnection policy selection Log *log.Logger // Logger instance SuppressLeaveEvents bool // When true the SDK doesn't send out the leave requests. DisablePNOtherProcessing bool // PNOther processing looks for pn_other in the JSON on the recevied message UseHTTP2 bool // HTTP2 Flag MessageQueueOverflowCount int // When the limit is exceeded by the number of messages received in a single subscribe request, a status event PNRequestMessageCountExceededCategory is fired. MaxIdleConnsPerHost int // Used to set the value of HTTP Transport's MaxIdleConnsPerHost. MaxWorkers int // Number of max workers for Publish and Grant requests }
Config instance is storage for user-provided information which describe further PubNub client behaviour. Configuration instance contain additional set of properties which allow to perform precise PubNub client configuration.
func NewDemoConfig ¶
func NewDemoConfig() *Config
NewDemoConfig initiates the config with demo keys, for tests only.
func (*Config) SetPresenceTimeout ¶
SetPresenceTimeout sets the presence timeout and automatically calulates the preferred timeout value. timeout: How long the server will consider the client alive for presence.
func (*Config) SetPresenceTimeoutWithCustomInterval ¶
SetPresenceTimeoutWithCustomInterval sets the presence timeout and interval. timeout: How long the server will consider the client alive for presence. interval: How often the client will announce itself to server.
type DeleteChannelGroupResponse ¶
type DeleteChannelGroupResponse struct{}
DeleteChannelGroupResponse is response structure for Delete Channel Group function
type FetchResponse ¶
type FetchResponse struct {
Messages map[string][]FetchResponseItem
}
FetchResponse is the response to Fetch request. It contains a map of type FetchResponseItem
type FetchResponseItem ¶
type FetchResponseItem struct { Message interface{} Timetoken string }
FetchResponseItem contains the message and the associated timetoken.
type GetStateResponse ¶
type GetStateResponse struct {
State map[string]interface{}
}
GetStateResponse is the struct returned when the Execute function of GetState is called.
type GrantResponse ¶
type GrantResponse struct { Level string SubscribeKey string TTL int Channels map[string]*PNPAMEntityData ChannelGroups map[string]*PNPAMEntityData ReadEnabled bool WriteEnabled bool ManageEnabled bool DeleteEnabled bool }
GrantResponse is the struct returned when the Execute function of Grant is called.
type HeartbeatManager ¶
HeartbeatManager is a struct that assists in running of the heartbeat.
func (*HeartbeatManager) Destroy ¶
func (m *HeartbeatManager) Destroy()
Destroy stops the running heartbeat.
type HereNowChannelData ¶
type HereNowChannelData struct { ChannelName string Occupancy int Occupants []HereNowOccupantsData }
HereNowChannelData is the struct containing the occupancy details of the channels.
type HereNowOccupantsData ¶
HereNowOccupantsData is the struct containing the state and UUID of the occupants in the channel.
type HereNowResponse ¶
type HereNowResponse struct { TotalChannels int TotalOccupancy int Channels []HereNowChannelData }
HereNowResponse is the struct returned when the Execute function of HereNow is called.
type HistoryDeleteResponse ¶
type HistoryDeleteResponse struct { }
HistoryDeleteResponse is the struct returned when Delete Messages is called.
type HistoryResponse ¶
type HistoryResponse struct { Messages []HistoryResponseItem StartTimetoken int64 EndTimetoken int64 }
HistoryResponse is used to store the response from the History request.
type HistoryResponseItem ¶
type HistoryResponseItem struct { Message interface{} Timetoken int64 }
HistoryResponseItem is used to store the Message and the associated timetoken from the History request.
type JobQItem ¶
type JobQItem struct { Req *http.Request Client *http.Client JobResponse chan *JobQResponse }
type JobQResponse ¶
type LatencyEntry ¶
LatencyEntry is the struct to store the timestamp and latency values.
type ListPushProvisionsRequestResponse ¶
type ListPushProvisionsRequestResponse struct {
Channels []string
}
ListPushProvisionsRequestResponse is the struct returned when the Execute function of ListPushProvisions is called.
type Listener ¶
type Listener struct { Status chan *PNStatus Message chan *PNMessage Presence chan *PNPresence }
func NewListener ¶
func NewListener() *Listener
type ListenerManager ¶
type OperationType ¶
type OperationType int
OperationType is used as an enum to catgorize the various operations in the APIs lifecycle
const ( // PNSubscribeOperation is the enum used for the Subcribe operation. PNSubscribeOperation OperationType = 1 + iota // PNUnsubscribeOperation is the enum used for the Unsubcribe operation. PNUnsubscribeOperation // PNPublishOperation is the enum used for the Publish operation. PNPublishOperation // PNFireOperation is the enum used for the Fire operation. PNFireOperation // PNHistoryOperation is the enum used for the History operation. PNHistoryOperation // PNFetchMessagesOperation is the enum used for the Fetch operation. PNFetchMessagesOperation // PNWhereNowOperation is the enum used for the Where Now operation. PNWhereNowOperation // PNHereNowOperation is the enum used for the Here Now operation. PNHereNowOperation // PNHeartBeatOperation is the enum used for the Heartbeat operation. PNHeartBeatOperation // PNSetStateOperation is the enum used for the Set State operation. PNSetStateOperation // PNGetStateOperation is the enum used for the Get State operation. PNGetStateOperation // PNAddChannelsToChannelGroupOperation is the enum used for the Add Channels to Channel Group operation. PNAddChannelsToChannelGroupOperation // PNRemoveChannelFromChannelGroupOperation is the enum used for the Remove Channels from Channel Group operation. PNRemoveChannelFromChannelGroupOperation // PNRemoveGroupOperation is the enum used for the Remove Channel Group operation. PNRemoveGroupOperation // PNChannelsForGroupOperation is the enum used for the List Channels of Channel Group operation. PNChannelsForGroupOperation // PNPushNotificationsEnabledChannelsOperation is the enum used for the List Channels with Push Notifications enabled operation. PNPushNotificationsEnabledChannelsOperation // PNAddPushNotificationsOnChannelsOperation is the enum used for the Add Channels to Push Notifications operation. PNAddPushNotificationsOnChannelsOperation // PNRemovePushNotificationsFromChannelsOperation is the enum used for the Remove Channels from Push Notifications operation. PNRemovePushNotificationsFromChannelsOperation // PNRemoveAllPushNotificationsOperation is the enum used for the Remove All Channels from Push Notifications operation. PNRemoveAllPushNotificationsOperation // PNTimeOperation is the enum used for the Time operation. PNTimeOperation // PNAccessManagerGrant is the enum used for the Access Manager Grant operation. PNAccessManagerGrant // PNAccessManagerRevoke is the enum used for the Access Manager Revoke operation. PNAccessManagerRevoke // PNDeleteMessagesOperation is the enum used for the Delete Messages from History operation. PNDeleteMessagesOperation )
func (OperationType) String ¶
func (t OperationType) String() string
type Operations ¶
type Operations struct {
// contains filtered or unexported fields
}
Operations is the struct to store the latency values of different operations.
type PNAccessManagerKeyData ¶
type PNAccessManagerKeyData struct { ReadEnabled bool WriteEnabled bool ManageEnabled bool DeleteEnabled bool TTL int }
PNAccessManagerKeyData is the struct containing the access details of the channel groups.
type PNGrantType ¶
type PNGrantType int
PNGrantType grant types
const ( // PNReadEnabled Read Enabled PNReadEnabled PNGrantType = 1 + iota // PNWriteEnabled Write Enabled PNWriteEnabled // PNManageEnabled Manage Enabled PNManageEnabled // PNDeleteEnabled Delete Enabled PNDeleteEnabled )
type PNPAMEntityData ¶
type PNPAMEntityData struct { Name string AuthKeys map[string]*PNAccessManagerKeyData ReadEnabled bool WriteEnabled bool ManageEnabled bool DeleteEnabled bool TTL int }
PNPAMEntityData is the struct containing the access details of the channels.
type PNPresence ¶
type PNPushType ¶
type PNPushType int
PNPushType is used as an enum to catgorize the available Push Types
const ( // PNPushTypeNone is used as an enum to for selecting `none` as the PNPushType PNPushTypeNone PNPushType = 1 + iota // PNPushTypeGCM is used as an enum to for selecting `GCM` as the PNPushType PNPushTypeGCM // PNPushTypeAPNS is used as an enum to for selecting `APNS` as the PNPushType PNPushTypeAPNS // PNPushTypeMPNS is used as an enum to for selecting `MPNS` as the PNPushType PNPushTypeMPNS )
func (PNPushType) String ¶
func (p PNPushType) String() string
type PubNub ¶
PubNub No server connection will be established when you create a new PubNub object. To establish a new connection use Subscribe() function of PubNub type.
func NewPubNubDemo ¶
func NewPubNubDemo() *PubNub
func (*PubNub) AddChannelToChannelGroup ¶
func (pn *PubNub) AddChannelToChannelGroup() *addChannelToChannelGroupBuilder
func (*PubNub) AddChannelToChannelGroupWithContext ¶
func (*PubNub) AddListener ¶
func (*PubNub) AddPushNotificationsOnChannels ¶
func (pn *PubNub) AddPushNotificationsOnChannels() *addPushNotificationsOnChannelsBuilder
func (*PubNub) AddPushNotificationsOnChannelsWithContext ¶
func (*PubNub) DeleteChannelGroup ¶
func (pn *PubNub) DeleteChannelGroup() *deleteChannelGroupBuilder
func (*PubNub) DeleteChannelGroupWithContext ¶
func (*PubNub) DeleteMessages ¶
func (pn *PubNub) DeleteMessages() *historyDeleteBuilder
func (*PubNub) DeleteMessagesWithContext ¶
func (*PubNub) FetchWithContext ¶
func (*PubNub) FireWithContext ¶
func (*PubNub) GetListeners ¶
func (*PubNub) GetStateWithContext ¶
func (*PubNub) GetSubscribeClient ¶
GetSubscribeClient Get a client for transactional requests
func (*PubNub) GetSubscribedChannels ¶
func (*PubNub) GetSubscribedGroups ¶
func (*PubNub) GrantWithContext ¶
func (*PubNub) HereNowWithContext ¶
func (*PubNub) HistoryWithContext ¶
func (*PubNub) LeaveWithContext ¶
func (*PubNub) ListChannelsInChannelGroup ¶
func (pn *PubNub) ListChannelsInChannelGroup() *allChannelGroupBuilder
func (*PubNub) ListChannelsInChannelGroupWithContext ¶
func (*PubNub) ListPushProvisions ¶
func (pn *PubNub) ListPushProvisions() *listPushProvisionsRequestBuilder
func (*PubNub) ListPushProvisionsWithContext ¶
func (*PubNub) PresenceWithContext ¶
func (*PubNub) PublishWithContext ¶
func (*PubNub) RemoveAllPushNotifications ¶
func (pn *PubNub) RemoveAllPushNotifications() *removeAllPushChannelsForDeviceBuilder
func (*PubNub) RemoveAllPushNotificationsWithContext ¶
func (*PubNub) RemoveChannelFromChannelGroup ¶
func (pn *PubNub) RemoveChannelFromChannelGroup() *removeChannelFromChannelGroupBuilder
func (*PubNub) RemoveChannelFromChannelGroupWithContext ¶
func (*PubNub) RemoveListener ¶
func (*PubNub) RemovePushNotificationsFromChannels ¶
func (pn *PubNub) RemovePushNotificationsFromChannels() *removeChannelsFromPushBuilder
func (*PubNub) RemovePushNotificationsFromChannelsWithContext ¶
func (*PubNub) SetStateWithContext ¶
func (*PubNub) SetSubscribeClient ¶
func (*PubNub) TimeWithContext ¶
func (*PubNub) Unsubscribe ¶
func (pn *PubNub) Unsubscribe() *unsubscribeBuilder
func (*PubNub) UnsubscribeAll ¶
func (pn *PubNub) UnsubscribeAll()
func (*PubNub) WhereNowWithContext ¶
type PublishResponse ¶
type PublishResponse struct {
Timestamp int64
}
PublishResponse is the response after the execution on Publish and Fire operations.
type ReconnectionManager ¶
type ReconnectionManager struct { sync.RWMutex ExponentialMultiplier int FailedCalls int Milliseconds int OnReconnection func() OnMaxReconnectionExhaustion func() DoneTimer chan bool // contains filtered or unexported fields }
ReconnectionManager is used to store the properties required in running the Reconnection Manager.
func (*ReconnectionManager) HandleOnMaxReconnectionExhaustion ¶
func (m *ReconnectionManager) HandleOnMaxReconnectionExhaustion(handler func())
HandleOnMaxReconnectionExhaustion sets the handler that will be called when the max reconnection attempts are exhausted.
func (*ReconnectionManager) HandleReconnection ¶
func (m *ReconnectionManager) HandleReconnection(handler func())
HandleReconnection sets the handler that will be called when the network reconnects after a disconnect.
type ReconnectionPolicy ¶
type ReconnectionPolicy int
ReconnectionPolicy is used as an enum to catgorize the reconnection policies
const ( // PNNonePolicy is to be used when selecting the no Reconnection Policy // ReconnectionPolicy is set in the config. PNNonePolicy ReconnectionPolicy = 1 + iota // PNLinearPolicy is to be used when selecting the Linear Reconnection Policy // ReconnectionPolicy is set in the config. PNLinearPolicy // PNExponentialPolicy is to be used when selecting the Exponential Reconnection Policy // ReconnectionPolicy is set in the config. PNExponentialPolicy )
type RemoveAllPushChannelsForDeviceResponse ¶
type RemoveAllPushChannelsForDeviceResponse struct{}
RemoveAllPushChannelsForDeviceResponse is the struct returned when the Execute function of RemoveAllPushNotifications is called.
type RemoveChannelFromChannelGroupResponse ¶
type RemoveChannelFromChannelGroupResponse struct { }
RemoveChannelFromChannelGroupResponse is the struct returned when the Execute function of RemoveChannelFromChannelGroup is called.
type RemoveChannelsFromPushResponse ¶
type RemoveChannelsFromPushResponse struct{}
RemoveChannelsFromPushResponse is the struct returned when the Execute function of RemovePushNotificationsFromChannels is called.
type RequestWorkers ¶
func (*RequestWorkers) Close ¶
func (p *RequestWorkers) Close()
func (*RequestWorkers) ReadQueue ¶
func (p *RequestWorkers) ReadQueue(pubnub *PubNub)
func (*RequestWorkers) Start ¶
func (p *RequestWorkers) Start(pubnub *PubNub)
type ResponseInfo ¶
type ResponseInfo struct { Operation OperationType StatusCode int TLSEnabled bool Origin string UUID string AuthKey string OriginalResponse *http.Response }
ResponseInfo is used to store the properties in the response of an request.
type SetStateResponse ¶
type SetStateResponse struct { State interface{} Message string }
SetStateResponse is the response returned when the Execute function of SetState is called.
type StateManager ¶
StateManager is used to store the subscriptions types
type StateOperation ¶
type StateOperation struct {
// contains filtered or unexported fields
}
type StatusCategory ¶
type StatusCategory int
StatusCategory is used as an enum to catgorize the various status events in the APIs lifecycle
const ( // PNUnknownCategory as the StatusCategory means an unknown status category event occurred. PNUnknownCategory StatusCategory = 1 + iota // PNTimeoutCategory as the StatusCategory means the request timeout has reached. PNTimeoutCategory // PNConnectedCategory as the StatusCategory means the channel is subscribed to receive messages. PNConnectedCategory // PNDisconnectedCategory as the StatusCategory means a disconnection occurred due to network issues. PNDisconnectedCategory // PNCancelledCategory as the StatusCategory means the context was cancelled. PNCancelledCategory // PNLoopStopCategory as the StatusCategory means the subscribe loop was stopped. PNLoopStopCategory // PNAcknowledgmentCategory as the StatusCategory is the Acknowledgement of an operation (like Unsubscribe). PNAcknowledgmentCategory // PNBadRequestCategory as the StatusCategory means the request was malformed. PNBadRequestCategory // PNAccessDeniedCategory as the StatusCategory means that PAM is enabled and the channel is not granted R/W access. PNAccessDeniedCategory // PNNoStubMatchedCategory as the StatusCategory means an unknown status category event occurred. PNNoStubMatchedCategory // PNReconnectedCategory as the StatusCategory means that the network was reconnected (after a disconnection). // Applicable on for PNLinearPolicy and PNExponentialPolicy. PNReconnectedCategory // PNReconnectionAttemptsExhausted as the StatusCategory means that the reconnection attempts // to reconnect to the network were exhausted. All channels would be unsubscribed at this point. // Applicable on for PNLinearPolicy and PNExponentialPolicy. // Reconnection attempts are set in the config: MaximumReconnectionRetries. PNReconnectionAttemptsExhausted // PNRequestMessageCountExceededCategory is fired when the MessageQueueOverflowCount limit is exceeded by the number of messages received in a single subscribe request PNRequestMessageCountExceededCategory )
func (StatusCategory) String ¶
func (c StatusCategory) String() string
type StatusResponse ¶
type StatusResponse struct { Error error Category StatusCategory Operation OperationType StatusCode int TLSEnabled bool UUID string AuthKey string Origin string OriginalResponse string Request string AffectedChannels []string AffectedChannelGroups []string }
StatusResponse is used to store the usable properties in the response of an request.
type SubscribeOperation ¶
type SubscribeOperation struct { Channels []string ChannelGroups []string PresenceEnabled bool Timetoken int64 FilterExpression string State map[string]interface{} QueryParam map[string]string }
SubscribeOperation
type SubscriptionItem ¶
type SubscriptionItem struct {
// contains filtered or unexported fields
}
SubscriptionItem is used to store the subscription item's properties.
type SubscriptionManager ¶
Heartbeat: - Heartbeat is enabled by default. - Default presence timeout is 300 seconds. - The first Heartbeat request will be scheduled to be executed after getHeartbeatInterval() seconds (default - 149).
func (*SubscriptionManager) AddListener ¶
func (m *SubscriptionManager) AddListener(listener *Listener)
func (*SubscriptionManager) Destroy ¶
func (m *SubscriptionManager) Destroy()
func (*SubscriptionManager) Disconnect ¶
func (m *SubscriptionManager) Disconnect()
func (*SubscriptionManager) GetListeners ¶
func (m *SubscriptionManager) GetListeners() map[*Listener]bool
func (*SubscriptionManager) RemoveAllListeners ¶
func (m *SubscriptionManager) RemoveAllListeners()
func (*SubscriptionManager) RemoveListener ¶
func (m *SubscriptionManager) RemoveListener(listener *Listener)
type TelemetryManager ¶
type TelemetryManager struct { sync.RWMutex ExitTelemetryManager chan bool IsRunning bool // contains filtered or unexported fields }
TelemetryManager is the struct to store the Telemetry details.
func (*TelemetryManager) CleanUpTelemetryData ¶
func (m *TelemetryManager) CleanUpTelemetryData()
CleanUpTelemetryData cleans up telemetry data of all operations.
func (*TelemetryManager) OperationLatency ¶
func (m *TelemetryManager) OperationLatency() map[string]string
OperationLatency returns a map of the stored latencies by operation.
func (*TelemetryManager) StoreLatency ¶
func (m *TelemetryManager) StoreLatency(latency float64, t OperationType)
StoreLatency stores the latency values of the different operations.
type TimeResponse ¶
type TimeResponse struct {
Timetoken int64
}
TimeResponse is the response when Time call is executed.
type UnsubscribeOperation ¶
type WhereNowResponse ¶
type WhereNowResponse struct {
Channels []string
}
WhereNowResponse is the response of the WhereNow request. Contains channels info.
Source Files ¶
- add_channel_channel_group_request.go
- add_channels_to_push_request.go
- clients.go
- config.go
- context.go
- delete_channel_group_request.go
- endpoints.go
- enums.go
- fetch_request.go
- fire_request.go
- get_state_request.go
- grant_request.go
- heartbeat_manager.go
- heartbeat_request.go
- here_now_request.go
- history_delete_request.go
- history_request.go
- leave_request.go
- list_all_channel_group_request.go
- list_push_provisions_request.go
- listener_manager.go
- presence_request.go
- publish_request.go
- pubnub.go
- reconnection_manager.go
- remove_all_push_channels_request.go
- remove_channel_channel_group_request.go
- remove_channels_from_push_request.go
- request.go
- request_context.go
- request_workers.go
- set_state_request.go
- state_manager.go
- subscribe_context_helper_1_7.go
- subscribe_request.go
- subscription_manager.go
- telemetry_manager.go
- time_request.go
- unsubscribe_builder.go
- where_now_request.go