speedtest

module
v0.0.0-...-e459bcc Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT

README

speedtest

Minimal library for testing an internet connection using Ookla's (https://www.speedtest.net) and Netflix's (https://fast.com/.)

Installation

go get -u github.com/a-s8h/speedtest

Usage

import "github.com/a-s8h/speedtest/pkg/speedtest"

func main() {
	// You can choose between ookla and netflix, netflixHeadlessChrome test providers. 
	// Result contains the Mbps for both download and upload
	tr, err := speedtest.Test(speedtest.ookla)
	fmt.Printf("speedtest.net download: %f Mbps, upload: %f Mbps", r.Download, r.Upload)
}

Dependencies

  • showwin/speedtest-go, uses for speedtest.net
  • gesquive/fast-cli, used to get api url for fast.com provider
  • chromedp/chromedp, used to scrape https://fast.com, google chrome required

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

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