ookla

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: CC-BY-4.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is Ookla's speedtest client

func NewClient

func NewClient(conf *config.Config, doer HTTPDoer) *Client

NewClient is a constructor for Ookla's speedtest client

func (*Client) MeasureDownload

func (c *Client) MeasureDownload(ctx context.Context) (
	downloadRate measurement.BitRate,
	err error,
)

MeasureDownload measures download speed per second using Ookla's speedtest.net API

func (*Client) MeasureUpload

func (c *Client) MeasureUpload(ctx context.Context) (
	uploadRate measurement.BitRate,
	err error,
)

MeasureUpload measures upload speed per second using Ookla's speedtest.net API

type HTTPDoer

type HTTPDoer interface {
	// Do sends an HTTP request and returns an HTTP response
	Do(req *http.Request) (*http.Response, error)
}

HTTPDoer is used for mocking purposes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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