Categorygithub.com/RadiusNetworks/pusher-ws-go
modulepackage
0.0.0-20230322162119-2785923201b5
Repository: https://github.com/radiusnetworks/pusher-ws-go.git
Documentation: pkg.go.dev

# README

pusher-ws-go

GoDoc Go Report Card Travis CI Build Status Codecov

This package implements a Pusher websocket client. It is based on the official Pusher JavaScript client libary as well as go-pusher.

Installation

$ go get github.com/goguardian/pusher-ws-go

Features

  • Connect to app
    • Custom cluster
    • Insecure connection
  • Subscribe to channel
    • Auth for private and presence channels
    • Custom auth parameters
    • Custom auth headers
  • Unsubscribe from channel
  • Bind to events
    • Bind at app level
    • Bind at channel level
    • Bind global at app level
    • Bind global at channel level
  • Unbind events
  • Presence channel member data
  • Cancel subscribing
  • Handle pong timeout/reconnect

# Packages

No description provided by the author

# Functions

UnmarshalDataString is a convenience function to unmarshal double-encoded JSON data from a Pusher event.
WithSuccessTimeout returns a SubscribeOption that sets the time that a subscription request will wait for a success response from Pusher before timing out.

# Variables

ErrMissingMe indicates a presence channel was subscribed to, but the pusher server violated the message protocol by not providing a member for the current user.
ErrNotSubscribed is returned by functions that require the channel to be subscribed before being called.
ErrTimedOut is the error returned when there is a timeout waiting for a subscription confirmation from Pusher.

# Structs

An AuthError is returned when a non-200 status code is returned in a channel subscription authentication request.
Client represents a Pusher websocket client.
Event represents an event sent to or received from a Pusher connection.
EventError represents an error event received from Pusher.
Member represents a channel member.

# Interfaces

Channel represents a subscription to a Pusher channel.
PresenceChannel provides information about the users that are currently subscribed.

# Type aliases

SubscribeOption is a configuration option for subscribing to a channel.