All Projects → ddo → go-fast

ddo / go-fast

Licence: MIT License
fast.com api for go - pure - no headless browser or stuff

Programming Languages

go
31211 projects - #10 most used programming language

go-fast Build Status Doc

fast.com api for go - pure - no headless browser or stuff

This package is the API for https://github.com/ddo/fast

Fast: Minimal zero-dependency utility for testing your internet download speed from terminal

Installation

go get -u gopkg.in/ddo/go-fast.v0

Workflow

  • #New
  • #Init
  • #GetUrls
  • #Measure

Example

fastCom := fast.New()

// init
err := fastCom.Init()
if err != nil {
    panic(err)
}

// get urls
urls, err := fastCom.GetUrls()
if err != nil {
    panic(err)
}

// measure
KbpsChan := make(chan float64)

go func() {
    for Kbps := range KbpsChan {
        fmt.Printf("%.2f Kbps %.2f Mbps\n", Kbps, Kbps/1000)
    }

    fmt.Println("done")
}()

err = fastCom.Measure(urls, KbpsChan)
if err != nil {
    panic(err)
}

Debug

to enable log set environment variable as

DLOG=*

Test

go test -v
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].