Documentation ¶
Overview ¶
Package messaging provides the implemetation to connect to pubnub api. Version: 3.7.1 Build Date: Apr 8, 2016
Index ¶
- func DecryptString(cipherKey string, message string) (retVal interface{}, err error)
- func EncryptString(cipherKey string, message string) string
- func GenUuid() (string, error)
- func GetNonSubscribeTimeout() uint16
- func GetResumeOnReconnect() bool
- func GetSubscribeTimeout() uint16
- func Logging() bool
- func LoggingEnabled(val bool)
- func ParseInterfaceData(myInterface interface{}) string
- func ParseJSON(contents []byte, cipherKey string) (string, string, string, error)
- func ParseSubscribeResponse(rawResponse []byte, cipherKey string) (messages [][]byte, channels, groups []string, timetoken string, err error)
- func SetConnectTimeout(val uint16)
- func SetIV(val string)
- func SetLogOutput(val io.Writer)
- func SetMaxIdleConnsPerHost(maxIdleConnsPerHostVal int)
- func SetMaxRetries(val int)
- func SetNonSubscribeTimeout(val uint16)
- func SetNonSubscribeTransport(transport http.RoundTripper)
- func SetOrigin(val string)
- func SetProxy(proxyServerVal string, proxyPortVal int, proxyUserVal string, ...)
- func SetResumeOnReconnect(val bool)
- func SetRetryInterval(val uint16)
- func SetSubscribeConn(conn net.Conn)
- func SetSubscribeTimeout(val uint16)
- func SetSubscribeTransport(transport http.RoundTripper)
- func SubscribeTimeout() <-chan time.Time
- func Timeout() <-chan time.Time
- func Timeouts(seconds uint16) <-chan time.Time
- func VersionInfo() string
- type PresenceEvent
- type PresenceResonse
- type Pubnub
- func (pub *Pubnub) Abort()
- func (pub *Pubnub) AuditChannelGroup(group, authKey string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) AuditPresence(channel, authKey string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) AuditSubscribe(channel, authKey string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) ChannelGroupAddChannel(group, channel string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) ChannelGroupListChannels(group string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) ChannelGroupRemoveChannel(group, channel string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) ChannelGroupRemoveGroup(group string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) ChannelGroupSubscribe(groups string, callbackChannel chan<- []byte, errorChannel chan<- []byte)
- func (pub *Pubnub) ChannelGroupSubscribeWithTimetoken(groups, timetoken string, callbackChannel chan<- []byte, ...)
- func (pub *Pubnub) ChannelGroupUnsubscribe(groups string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) CloseExistingConnection()
- func (pub *Pubnub) GetAuthenticationKey() string
- func (pub *Pubnub) GetPresenceHeartbeat() uint16
- func (pub *Pubnub) GetPresenceHeartbeatInterval() uint16
- func (pub *Pubnub) GetTime(callbackChannel chan []byte, errorChannel chan []byte)
- func (pub *Pubnub) GetUUID() string
- func (pub *Pubnub) GetUserState(channel string, callbackChannel chan []byte, errorChannel chan []byte)
- func (pub *Pubnub) GlobalHereNow(showUuid bool, includeUserState bool, callbackChannel chan []byte, ...)
- func (pub *Pubnub) GrantChannelGroup(group string, read, manage bool, ttl int, authKey string, ...)
- func (pub *Pubnub) GrantPresence(channel string, read, write bool, ttl int, authKey string, ...)
- func (pub *Pubnub) GrantSubscribe(channel string, read, write bool, ttl int, authKey string, ...)
- func (pub *Pubnub) HereNow(channel string, showUuid bool, includeUserState bool, ...)
- func (pub *Pubnub) History(channel string, limit int, start int64, end int64, reverse bool, ...)
- func (pub *Pubnub) PresenceUnsubscribe(channels string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) Publish(channel string, message interface{}, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) PublishExtended(channel string, message interface{}, storeInHistory, doNotSerialize bool, ...)
- func (pub *Pubnub) SetAuthenticationKey(val string)
- func (pub *Pubnub) SetPresenceHeartbeat(val uint16)
- func (pub *Pubnub) SetPresenceHeartbeatInterval(val uint16)
- func (pub *Pubnub) SetUUID(val string)
- func (pub *Pubnub) SetUserStateJSON(channel string, jsonString string, callbackChannel chan []byte, ...)
- func (pub *Pubnub) SetUserStateKeyVal(channel string, key string, val string, callbackChannel chan []byte, ...)
- func (pub *Pubnub) Subscribe(channels, timetoken string, callbackChannel chan<- []byte, isPresence bool, ...)
- func (pub *Pubnub) Unsubscribe(channels string, callbackChannel, errorChannel chan []byte)
- func (pub *Pubnub) WhereNow(uuid string, callbackChannel chan []byte, errorChannel chan []byte)
- type PubnubUnitTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptString ¶
DecryptString decodes encrypted string using the cipherKey
It accepts the following parameters: cipherKey: cipher key to use to decrypt. message: to encrypted.
returns the unencoded encrypted string, error if any.
func EncryptString ¶
EncryptString creates the base64 encoded encrypted string using the cipherKey. It accepts the following parameters: cipherKey: cipher key to use to encrypt. message: to encrypted.
returns the base64 encoded encrypted string.
func GetNonSubscribeTimeout ¶
func GetNonSubscribeTimeout() uint16
GetNonSubscribeTimeout gets the value of nonSubscribeTimeout
func GetResumeOnReconnect ¶
func GetResumeOnReconnect() bool
GetResumeOnReconnect returns the value of resumeOnReconnect.
func GetSubscribeTimeout ¶
func GetSubscribeTimeout() uint16
GetSubscribeTimeout gets the value of subscribeTimeout
func Logging ¶
func Logging() bool
Logging gets the value of loggingEnabled If true logs will be written to a file
func LoggingEnabled ¶
func LoggingEnabled(val bool)
LoggingEnabled sets the value of loggingEnabled If true logs will be written to the logfileWriter In addition to LoggingEnabled you also need to init the logfileWriter using SetLogOutput
func ParseInterfaceData ¶
func ParseInterfaceData(myInterface interface{}) string
ParseInterfaceData formats the data to string as per the type of the data.
It accepts the following parameters: myInterface: the interface data to parse and convert to string.
returns: the data in string format.
func ParseJSON ¶
ParseJSON parses the json data. It extracts the actual data (value 0), Timetoken/from time in case of detailed history (value 1), pubnub channelname/timetoken/to time in case of detailed history (value 2).
It accepts the following parameters: contents: the contents to parse. cipherKey: the key to decrypt the messages (can be empty).
returns: data: as string. Timetoken/from time in case of detailed history as string. pubnub channelname/timetoken/to time in case of detailed history (value 2). error if any.
func ParseSubscribeResponse ¶
func ParseSubscribeResponse(rawResponse []byte, cipherKey string) ( messages [][]byte, channels, groups []string, timetoken string, err error)
ParseSubscribeResponse It extracts the actual data (value 0), Timetoken/from time in case of detailed history (value 1), pubnub channelname/timetoken/to time in case of detailed history (value 2).
It accepts the following parameters: contents: the contents to parse. cipherKey: the key to decrypt the messages (can be empty).
returns: messages: as [][]byte. channels: as string. groups: as string. Timetoken/from time in case of detailed history as string. error: if any.
func SetConnectTimeout ¶
func SetConnectTimeout(val uint16)
SetConnectTimeout sets the value of connectTimeout.
func SetLogOutput ¶
SetLogOutput sets the full path of the logfile Default name is pubnubMessaging.log and is located in the same dir from where the go file is run In addition to this LoggingEnabled should be true for this to work.
func SetMaxIdleConnsPerHost ¶
func SetMaxIdleConnsPerHost(maxIdleConnsPerHostVal int)
SetMaxIdleConnsPerHost is used to set the value of HTTP Transport's MaxIdleConnsPerHost. It restricts how many connections there are which are not actively serving requests, but which the client has not closed. Be careful when increasing MaxIdleConnsPerHost to a large number. It only makes sense to increase idle connections if you are seeing many connections in a short period from the same clients.
func SetNonSubscribeTimeout ¶
func SetNonSubscribeTimeout(val uint16)
SetNonSubscribeTimeout sets the value of nonsubscribeTimeout.
func SetNonSubscribeTransport ¶
func SetNonSubscribeTransport(transport http.RoundTripper)
func SetOrigin ¶
func SetOrigin(val string)
SetOrigin sets the value of _origin. Should be called before PubnubInit
func SetProxy ¶
func SetProxy(proxyServerVal string, proxyPortVal int, proxyUserVal string, proxyPasswordVal string)
SetProxy sets the global variables for the parameters. It also sets the proxyServerEnabled value to true.
It accepts the following parameters: proxyServer proxy server name or ip. proxyPort proxy port. proxyUser proxyUserName. proxyPassword proxyPassword.
func SetResumeOnReconnect ¶
func SetResumeOnReconnect(val bool)
SetResumeOnReconnect sets the value of resumeOnReconnect.
func SetRetryInterval ¶
func SetRetryInterval(val uint16)
SetRetryInterval sets the value of retryInterval.
func SetSubscribeConn ¶
func SetSubscribeTimeout ¶
func SetSubscribeTimeout(val uint16)
SetSubscribeTimeout sets the value of subscribeTimeout.
func SetSubscribeTransport ¶
func SetSubscribeTransport(transport http.RoundTripper)
func SubscribeTimeout ¶
Timeout channel for subscribe requests
func VersionInfo ¶
func VersionInfo() string
VersionInfo returns the version of the this code along with the build date.
Types ¶
type PresenceEvent ¶
type PresenceEvent struct { Action string `json:"action"` Uuid string `json:"uuid"` Timestamp float64 `json:"timestamp"` Occupancy int `json:"occupancy"` }
Type for presence events
type PresenceResonse ¶
type PresenceResonse struct { Action string `json:"action"` Status int `json:"status"` Service string `json:"service"` Message string `json:"message"` }
Type for presence response
type Pubnub ¶
Pubnub structure. origin stores the root url value of pubnub api in the current instance. publishKey stores the user specific Publish Key in the current instance. subscribeKey stores the user specific Subscribe Key in the current instance. secretKey stores the user specific Secret Key in the current instance. cipherKey stores the user specific Cipher Key in the current instance. authenticationKey stores the Authentication Key in the current instance. isSSL is true if enabled, else is false for the current instance. uuid is the unique identifier, it can be a custom value or is automatically generated. timeToken is the current value of the servertime. This will be used to appened in each request. sentTimeToken: This is the timetoken sent to the server with the request resetTimeToken: In case of a new request or an error this variable is set to true so that the
timeToken will be set to 0 in the next request.
channels: container for channels groups: container for channels groups isPresenceHeartbeatRunning a variable to keep a check on the presence heartbeat's status Mutex to lock the operations on the instance
func NewPubnub ¶
func NewPubnub(publishKey string, subscribeKey string, secretKey string, cipherKey string, sslOn bool, customUuid string) *Pubnub
NewPubnub initializes pubnub struct with the user provided values. And then initiates the origin by appending the protocol based upon the sslOn argument. Then it uses the customuuid or generates the uuid.
It accepts the following parameters: publishKey is the user specific Publish Key. Mandatory. subscribeKey is the user specific Subscribe Key. Mandatory. secretKey is the user specific Secret Key. Accepts empty string if not used. cipherKey stores the user specific Cipher Key. Accepts empty string if not used. sslOn is true if enabled, else is false. customUuid is the unique identifier, it can be a custom value or sent as empty for automatic generation.
returns the pointer to Pubnub instance.
func (*Pubnub) Abort ¶
func (pub *Pubnub) Abort()
Abort is the struct Pubnub's instance method that closes the open connections for both subscribe and non-subscribe requests.
It also sends a leave request for all the subscribed channel and resets both channel and group collections to break the loop in the func StartSubscribeLoop
func (*Pubnub) AuditChannelGroup ¶
func (pub *Pubnub) AuditChannelGroup(group, authKey string, callbackChannel, errorChannel chan []byte)
AuditChannelGroup will make a call to display the permissions for a channel group or subkey
func (*Pubnub) AuditPresence ¶
func (pub *Pubnub) AuditPresence(channel, authKey string, callbackChannel, errorChannel chan []byte)
AuditPresence will make a call to display the permissions for a channel or subkey
channel is options and if not provided will set the permissions at subkey level
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) AuditSubscribe ¶
func (pub *Pubnub) AuditSubscribe(channel, authKey string, callbackChannel, errorChannel chan []byte)
AuditSubscribe will make a call to display the permissions for a channel or subkey
channel is options and if not provided will set the permissions at subkey level
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) ChannelGroupAddChannel ¶
func (*Pubnub) ChannelGroupListChannels ¶
func (*Pubnub) ChannelGroupRemoveChannel ¶
func (*Pubnub) ChannelGroupRemoveGroup ¶
func (*Pubnub) ChannelGroupSubscribe ¶
func (*Pubnub) ChannelGroupSubscribeWithTimetoken ¶
func (*Pubnub) ChannelGroupUnsubscribe ¶
func (*Pubnub) CloseExistingConnection ¶
func (pub *Pubnub) CloseExistingConnection()
CloseExistingConnection closes the open subscribe/presence connection.
func (*Pubnub) GetAuthenticationKey ¶
GetAuthenticationKey gets the value of authentication key
func (*Pubnub) GetPresenceHeartbeat ¶
GetPresenceHeartbeat gets the value of presenceHeartbeat
func (*Pubnub) GetPresenceHeartbeatInterval ¶
GetPresenceHeartbeatInterval gets the value of presenceHeartbeatInterval
func (*Pubnub) GetTime ¶
GetTime is the struct Pubnub's instance method that calls the ExecuteTime method to process the time request. . It accepts the following parameters: callbackChannel on which to send the response. errorChannel on which to send the error response.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) GetUserState ¶
func (pub *Pubnub) GetUserState(channel string, callbackChannel chan []byte, errorChannel chan []byte)
GetUserState is the struct Pubnub's instance method which creates and posts the GetUserState request to get the connected users details.
It accepts the following parameters: channel: a single value of the pubnub channel. callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) GlobalHereNow ¶
func (pub *Pubnub) GlobalHereNow(showUuid bool, includeUserState bool, callbackChannel chan []byte, errorChannel chan []byte)
GlobalHereNow is the struct Pubnub's instance method which creates and posts the globalherenow request to get the connected users details.
It accepts the following parameters: showUuid: if true uuids of devices will be fetched in the respose includeUserState: if true the user states of devices will be fetched in the respose callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) GrantChannelGroup ¶
func (pub *Pubnub) GrantChannelGroup(group string, read, manage bool, ttl int, authKey string, callbackChannel, errorChannel chan []byte)
GrantChannelGroup is used to give a channel group read or manage permissions and set TTL values for it.
ttl values:
-1: do not include ttl param to query, use default (60 minutes) 0: permissions will never expire 1..525600: from 1 minute to 1 year(in minutes)
func (*Pubnub) GrantPresence ¶
func (pub *Pubnub) GrantPresence(channel string, read, write bool, ttl int, authKey string, callbackChannel, errorChannel chan []byte)
GrantPresence is used to give a presence channel read, write permissions and set TTL values for it. To grant a permission set read or write as true to revoke all perms set read and write false and ttl as -1
ttl values:
-1: do not include ttl param to query, use default (60 minutes) 0: permissions will never expire 1..525600: from 1 minute to 1 year(in minutes)
channel is options and if not provided will set the permissions at subkey level
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) GrantSubscribe ¶
func (pub *Pubnub) GrantSubscribe(channel string, read, write bool, ttl int, authKey string, callbackChannel, errorChannel chan []byte)
GrantSubscribe is used to give a subscribe channel read, write permissions and set TTL values for it. To grant a permission set read or write as true to revoke all perms set read and write false and ttl as -1
ttl values:
-1: do not include ttl param to query, use default (60 minutes) 0: permissions will never expire 1..525600: from 1 minute to 1 year(in minutes)
channel is options and if not provided will set the permissions at subkey level
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) HereNow ¶
func (pub *Pubnub) HereNow(channel string, showUuid bool, includeUserState bool, callbackChannel chan []byte, errorChannel chan []byte)
HereNow is the struct Pubnub's instance method which creates and posts the herenow request to get the connected users details.
It accepts the following parameters: channel: a single value of the pubnub channel. callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) History ¶
func (pub *Pubnub) History(channel string, limit int, start int64, end int64, reverse bool, callbackChannel chan []byte, errorChannel chan []byte)
History is the struct Pubnub's instance method which creates and post the History request for a single pubnub channel.
It parses the response to get the data and return it to the channel.
It accepts the following parameters: channel: a single value of the pubnub channel. limit: number of history messages to return. start: start time from where to begin the history messages. end: end time till where to get the history messages. reverse: to fetch the messages in ascending order callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) PresenceUnsubscribe ¶
PresenceUnsubscribe is the struct Pubnub's instance method which unsubscribes a pubnub presence channel(s) from the subscribe loop.
If all the pubnub channels are not removed the method StartSubscribeLoop will take care of it by starting a new loop. When the pubnub channel(s) are removed it creates and posts a leave request.
It accepts the following parameters: channels: the pubnub channel(s) in a comma separated string. callbackChannel: Channel on which to send the response back. errorChannel: channel to send an error response to.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) Publish ¶
func (pub *Pubnub) Publish(channel string, message interface{}, callbackChannel, errorChannel chan []byte)
Publish is the struct Pubnub's instance method that creates a publish request and calls SendPublishRequest to post the request.
It calls the InvalidChannel and InvalidMessage methods to validate the Pubnub channels and message. Calls the GetHmacSha256 to generate a signature if a secretKey is to be used. Creates the publish url Calls json marshal Calls the EncryptString method is the cipherkey is used and calls json marshal Closes the channel after the response is received
It accepts the following parameters: channel: The Pubnub channel to which the message is to be posted. message: message to be posted. callbackChannel: Channel on which to send the response back. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) PublishExtended ¶
func (pub *Pubnub) PublishExtended(channel string, message interface{}, storeInHistory, doNotSerialize bool, callbackChannel, errorChannel chan []byte)
Publish is the struct Pubnub's instance method that creates a publish request and calls SendPublishRequest to post the request.
It calls the InvalidChannel and InvalidMessage methods to validate the Pubnub channels and message. Calls the GetHmacSha256 to generate a signature if a secretKey is to be used. Creates the publish url Calls json marshal Calls the EncryptString method is the cipherkey is used and calls json marshal Closes the channel after the response is received
It accepts the following parameters: channel: The Pubnub channel to which the message is to be posted. message: message to be posted. storeInHistory: Message will be persisted in Storage & Playback db doNotSerialize: Set this option to true if you use your own serializer. In this case passed-in message should be a string or []byte callbackChannel: Channel on which to send the response back. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) SetAuthenticationKey ¶
SetAuthenticationKey sets the value of authentication key
func (*Pubnub) SetPresenceHeartbeat ¶
SetPresenceHeartbeat sets the value of presence heartbeat. When the presence heartbeat is set the presenceHeartbeatInterval is automatically set to (presenceHeartbeat / 2) - 1 Starts the presence heartbeat request if both presenceHeartbeatInterval and presenceHeartbeat are set and a presence notifications are subsribed
func (*Pubnub) SetPresenceHeartbeatInterval ¶
SetPresenceHeartbeatInterval sets the value of presenceHeartbeatInterval. If the value is greater than presenceHeartbeat and there is a value set for presenceHeartbeat then is automatically set to (presenceHeartbeat / 2) - 1 Starts the presence heartbeat request if both presenceHeartbeatInterval and presenceHeartbeat are set and a presence notifications are subsribed
func (*Pubnub) SetUserStateJSON ¶
func (pub *Pubnub) SetUserStateJSON(channel string, jsonString string, callbackChannel chan []byte, errorChannel chan []byte)
SetUserStateJSON is the struct Pubnub's instance method which creates and posts the User state request using JSON as input
It accepts the following parameters: channel: a single value of the pubnub channel. jsonString: the user state in JSON format. If invalid an error will be thrown callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) SetUserStateKeyVal ¶
func (pub *Pubnub) SetUserStateKeyVal(channel string, key string, val string, callbackChannel chan []byte, errorChannel chan []byte)
SetUserStateKeyVal is the struct Pubnub's instance method which creates and posts the userstate request using a key/val map
It accepts the following parameters: channel: a single value of the pubnub channel. key: user states key value: user stated value callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) Subscribe ¶
func (pub *Pubnub) Subscribe(channels, timetoken string, callbackChannel chan<- []byte, isPresence bool, errorChannel chan<- []byte)
Subscribe is the struct Pubnub's instance method which checks for the InvalidChannels and returns if true. Initaiates the presence and subscribe response channels.
If there is no existing subscribe/presence loop running then it starts a new loop with the new pubnub channels. Else closes the existing connections and starts a new loop
It accepts the following parameters: channels: comma separated pubnub channel list. timetoken: if timetoken is present the subscribe request is sent using this timetoken successChannel: Channel on which to send the success response back. errorChannel: channel to send an error response to. eventsChannel: Channel on which to send events like connect/disconnect/reconnect.
func (*Pubnub) Unsubscribe ¶
Unsubscribe is the struct Pubnub's instance method which unsubscribes a pubnub subscribe channel(s) from the subscribe loop.
If all the pubnub channels are not removed the method StartSubscribeLoop will take care of it by starting a new loop. Closes the channel c when the processing is complete
It accepts the following parameters: channels: the pubnub channel(s) in a comma separated string. callbackChannel: Channel on which to send the response back. errorChannel: channel to send an error response to.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
func (*Pubnub) WhereNow ¶
WhereNow is the struct Pubnub's instance method which creates and posts the wherenow request to get the connected users details.
It accepts the following parameters: uuid: devcie uuid to pass to the wherenow query callbackChannel on which to send the response. errorChannel on which the error response is sent.
Both callbackChannel and errorChannel are mandatory. If either is nil the code will panic
type PubnubUnitTest ¶
type PubnubUnitTest struct { }
PubnubUnitTest structure used to expose some data for unit tests.
func (*PubnubUnitTest) GetSentTimeToken ¶
func (pubtest *PubnubUnitTest) GetSentTimeToken(pub *Pubnub) string
GetSentTimeToken returns the timetoken sent to the server, is used only for unit tests
func (*PubnubUnitTest) GetTimeToken ¶
func (pubtest *PubnubUnitTest) GetTimeToken(pub *Pubnub) string
GetTimeToken returns the latest timetoken received from the server, is used only for unit tests