driver

package
v0.0.0-...-28bcc08 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WSClient

type WSClient struct {
	AccessToken string

	Timeout time.Duration
	URL     string
	// contains filtered or unexported fields
}

WSClient defines the default websocket client.

func NewWebSocketClient

func NewWebSocketClient(url, accessToken string, timeout time.Duration) *WSClient

NewWebSocketClient returns a websocket client.

func (*WSClient) CallAPI

func (c *WSClient) CallAPI(req *nilbot.APIRequest) (resp *nilbot.APIResponse, err error)

CallAPI sends websocket request.

func (*WSClient) Connect

func (c *WSClient) Connect()

Connect websocket server.

func (*WSClient) Listen

func (c *WSClient) Listen(handler ...nilbot.EventHandler)

Listen websocket events.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL