speedy

package module
v0.0.0-...-b6616a0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

README ΒΆ

speedy

GitHub go.mod Go version GoDoc view examples build status Code Coverage

Go library to test internet speed using fast.com and speedtest.net

🚚 Install

go get -u github.com/tsirysndr/speedy

πŸš€ Usage

import (
	"fmt"

	"github.com/tsirysndr/speedy"
)

func main() {
	r, _ := speedy.Start(speedy.OOKLA) // Or speedy.NETFLIX
	fmt.Printf("Download: %f Mbps | Upload: %f Mbps", r.Download, r.Upload)
}

Run tests

go test

Author

πŸ‘€ Tsiry Sandratraina

Show your support

Give a ⭐️ if this project helped you!

πŸ“ License

Copyright Β© 2021 Tsiry Sandratraina.
This project is BSD licensed.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

View Source
const NETFLIX_URL = "https://fast.com/"

Variables ΒΆ

This section is empty.

Functions ΒΆ

func GetChunkedResult ΒΆ

func GetChunkedResult(url string) (int, error)

func GetFilesize ΒΆ

func GetFilesize(url string) (int64, error)

func GetHtmlResult ΒΆ

func GetHtmlResult(url string) (string, error)

func NetflixDownloadTest ΒΆ

func NetflixDownloadTest() (float64, error)

func NetflixUploadTest ΒΆ

func NetflixUploadTest() (float64, error)

func ParseJsPath ΒΆ

func ParseJsPath() (string, error)

func ParseToken ΒΆ

func ParseToken() (string, error)

Types ΒΆ

type Provider ΒΆ

type Provider string
const (
	OOKLA   Provider = "ookla"
	NETFLIX Provider = "netflix"
)

type Result ΒΆ

type Result struct {
	Download float64
	Upload   float64
}

func Start ΒΆ

func Start(p Provider) (*Result, error)

func StartNetflixTest ΒΆ

func StartNetflixTest() (*Result, error)

func StartOoklaTest ΒΆ

func StartOoklaTest() (*Result, error)

type UrlResponse ΒΆ

type UrlResponse struct {
	URL string `json:"url"`
}

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

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