Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client connection to an faye server.
func NewClient ¶
NewClient creates a new faye client with the provided options and connect to the specified url.
func (*Client) Disconnect ¶
Disconnect closes all subscriptions and inform the server to remove any client-related state. any subsequent method call to the client object will result in undefined behaviour.
func (*Client) Publish ¶
Publish publishes events on a channel by sending event messages, the server MAY respond to a publish event if this feature is supported by the server use the OnPublishResponse to get the publish status.
func (*Client) Subscribe ¶
func (c *Client) Subscribe(channel string, authToken string) (*subscription.Subscription, error)
Subscribe informs the server that messages published to that channel are delivered to itself.
type Option ¶
type Option func(*options)
Option set the Client options, such as Transport, message extensions,etc.
func WithExtension ¶
WithExtension append the provided incoming extension and outgoing to the list of incoming and outgoing extensions. extensions run in the order that they are provided
func WithInExtension ¶
WithInExtension append the provided incoming extension to the list of incoming extensions. extensions run in the order that they are provided
func WithOutExtension ¶
WithOutExtension append the provided outgoing extension to the the default transport options extensions run in the order that they are provided
func WithTransport ¶
WithTransport sets the client transport to be used to communicate with server.