client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package client implements the DASH client

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrServerBusy is returned when the Neubot server is busy.
	ErrServerBusy = errors.New("Server busy; try again later")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// ClientName is the name of the client application. This field is
	// initialized by the NewClient constructor.
	ClientName string

	// ClientVersion is the version of the client application. This field is
	// initialized by the NewClient constructor.
	ClientVersion string

	// FQDN is the server of the server to use. If the FQDN is not
	// specified, we'll use mlab-ns to discover a server.
	FQDN string

	// HTTPClient is the HTTP client used by this implementation. This field
	// is initialized by the NewClient to http.DefaultClient.
	HTTPClient *http.Client

	// Logger is the logger to use. This field is initialized by the
	// NewClient constructor to a do-nothing logger.
	Logger model.Logger

	// MLabNSClient is the mlabns client. We'll configure it with
	// defaults in NewClient and you may override it.
	MLabNSClient *mlabns.Client

	// Scheme is the Scheme to use. By default we configure
	// it to "http". Future versions of the server will also
	// have support for "https" testing.
	Scheme string
	// contains filtered or unexported fields
}

Client is a DASH client

func New

func New(clientName, clientVersion string) (client *Client)

New creates a new Client instance using the specified client application name and version.

func (*Client) Error

func (c *Client) Error() error

Error returns the error that occurred during the test, if any. A nil return value means that all was good. A returned error does not however necessarily mean that all was bad; you may have _some_ data.

func (*Client) ServerResults

func (c *Client) ServerResults() []model.ServerResults

ServerResults returns the results of the experiment collected by the server. In case Error() returns non nil, this function will typically return an empty slice to the caller.

func (*Client) StartDownload

func (c *Client) StartDownload(ctx context.Context) (<-chan model.ClientResults, error)

StartDownload starts the DASH download. It returns a channel where client measurements are posted, or an error. This function will only fail if we cannot even initiate the experiment. If you see some results on the returned channel, then maybe it means the experiment has somehow worked. You can see if there has been any error during the experiment by using the Error function.

Jump to

Keyboard shortcuts

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