Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // PortierURL is the URL of the portier server PortierURL string // APIToken is the API token of the portier server APIToken string // MaxReconnectInterval is the maximum time to wait between reconnects MaxReconnectInterval time.Duration // ReconnectRetries is the number of retries to reconnect to the portier server ReconnectRetries int64 }
type Uplink ¶
type Uplink interface { // Connect connects to the portier server return recv channel to receive messages from the portier server. // The channels will be to be closed by the uplink when the connection to the portier server is closed. // The recv channel will have no buffer and it is mandatory that the Router processes messages in a non-blocking way. Connect() (<-chan messages.Message, error) // Send enqueues a message to the portier server. // The Uplink has only a small buffer to realize backpressure in case the uplink cannot keep up with the messages, i.e. it will block. // This blocking must be effectively throttling the Service. Send(messages.Message) error // Close closes the uplink, the connection to the portier server and expects the uplink to close the recv channel Close() error // Returns a recv channel to listen for events Events() <-chan Event }
Uplink is the uplink interface to the portier server. It is used to send messages to the portier server and to receive messages from the portier server. Moreover, it has to handle connection loss and reconnect to the portier server.
type WebsocketUplink ¶
type WebsocketUplink struct { // Options defines the options for the uplink Options Options // contains filtered or unexported fields }
func NewWebsocketUplink ¶
func NewWebsocketUplink(options Options, encoderDecoder encoder.EncoderDecoder) *WebsocketUplink
NewWebsocketUplink creates a new websocket uplink.
func (*WebsocketUplink) Close ¶
func (u *WebsocketUplink) Close() error
Close closes the uplink, the connection to the portier server and expects the uplink to close the recv channel.
func (*WebsocketUplink) Connect ¶
func (u *WebsocketUplink) Connect() (<-chan messages.Message, error)
Connect connects to the portier server return recv channel to receive messages from the portier server.
func (*WebsocketUplink) Events ¶
func (u *WebsocketUplink) Events() <-chan Event
Click to show internal directories.
Click to hide internal directories.