speedtest

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "speedtest"

Variables

View Source
var ErrAlreadyRunning = errors.New("speed test is already running")
View Source
var ErrNotFound = errors.New("speed test was not found")

Functions

This section is empty.

Types

type Result

type Result struct {
	State         string `json:"state"`
	BitsPerSecond int64  `json:"bitsPerSecond,omitempty"`
	Error         string `json:"error,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(tester Tester, logger *log.Logger) *Service

func (*Service) CancelManual added in v0.0.4

func (s *Service) CancelManual(ip string) (Result, error)

func (*Service) Name

func (s *Service) Name() string

func (*Service) QueueManual

func (s *Service) QueueManual(ip string) (Result, error)

QueueManual adds one node requested by an authenticated API user. Refresh, health-check, and connection workflows must not enqueue speed tests.

func (*Service) Restart

func (s *Service) Restart(ctx context.Context) error

func (*Service) Result

func (s *Service) Result(ip string) (Result, bool)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Status

func (s *Service) Status() service.Status

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) error

type Tester

type Tester interface {
	TestNode(context.Context, string) (int64, error)
}

Jump to

Keyboard shortcuts

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