speedtest

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultURL     = "https://speed.cloudflare.com/__down?bytes=10000000"
	DefaultMaxByte = 10_000_000
)

Variables

This section is empty.

Functions

func Format

func Format(result Result) string

Types

type Options

type Options struct {
	URL      string
	MaxBytes int64
	Timeout  time.Duration
}

type Result

type Result struct {
	URL      string        `json:"url"`
	Bytes    int64         `json:"bytes"`
	Duration time.Duration `json:"duration"`
	Mbps     float64       `json:"mbps"`
}

func Run

func Run(ctx context.Context, opts Options) (Result, error)

Jump to

Keyboard shortcuts

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