client

package
v0.0.0-...-dfc6be9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	ServerURL: "ooblistener.ru",
}

DefaultOptions is the default options for the interact client

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for communicating with ooblistener server instance.

func New

func New(options *Options) (*Client, error)

New creates a new client instance based on provided options

func (*Client) Close

func (c *Client) Close() error

Close closes the collaborator client and deregisters from the collaborator server if not explicitly asked by the user.

func (*Client) StartPolling

func (c *Client) StartPolling(duration time.Duration, callback InteractionCallback)

StartPolling starts polling the server each duration and returns any events that may have been captured by the collaborator server.

func (*Client) StopPolling

func (c *Client) StopPolling()

StopPolling stops the polling to the ooblistener server.

func (*Client) URL

func (c *Client) URL() string

URL returns a new URL that can be used for external interaction requests.

type InteractionCallback

type InteractionCallback func(*server.Interaction)

InteractionCallback is a callback function for a reported interaction

type Options

type Options struct {
	// ServerURL is the URL for the ooblistener server.
	ServerURL string
	// PersistentSession keeps the session open for future requests.
	PersistentSession bool
	// Token if the server requires authentication
	Token string
	// DisableHTTPFallback determines if failed requests over https should not be retried over http
	DisableHTTPFallback bool
}

Options contains configuration options for ooblistener client

Jump to

Keyboard shortcuts

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