Documentation
¶
Overview ¶
Package client implements the DASH client
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
New creates a new Client instance using the specified client application name and version.
func (*Client) 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 ¶
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.