Skip to content

An API written in Go for testing download/upload speed using speedtest.net and fast.com

License

Notifications You must be signed in to change notification settings

bejaneps/speedtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speedtest

Speedtest is an API for testing download and upload speeds using Ookla's https://speedtest.net and Netflix https://fast.com

Usage

First go get and import package

go get -v github.com/bejaneps/speedtest

Then, import package in your code

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/bejaneps/speedtest"
)

func main() {
	measurer := speedtest.New(
		speedtest.OoklaSpeedtest,
		speedtest.WithServerCount(10),
	)

	rate, err := measurer.MeasureDownload(context.Background())
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(rate.MbpsStr())
}

TODO

  • Add implementation for Netflix's fast.com tool
  • Add functionality for latency check
  • Add functionality for closest server
  • Add warmup functionality for different length/width and workload for Ookla's speedtest.net
  • Replace std logger to uber's zap
  • Setup Github Action's CI for code linting and commit style check
  • Add some integration tests
  • Improve error messages with custom error struct
  • Add benchmarks
  • More unit tests

About

An API written in Go for testing download/upload speed using speedtest.net and fast.com

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages