Version: v1.3.1 Latest Latest

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

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 12 Imported by: 0




View Source
const DefaultURL = `https://www.youtube.com/`

DefaultURL .

View Source
const StatusError = 2

StatusError 錯誤

View Source
const StatusOk = 3

StatusOk 完成

View Source
const StatusRunning = 1

StatusRunning 正在運行


This section is empty.


func TestOne

func TestOne(outbound *data.Outbound, url string) (duration time.Duration, e error)

TestOne .


type Context

type Context struct {
	// contains filtered or unexported fields

Context 速度測試 環境

func New

func New(url string) *Context

New .

func (*Context) Close

func (s *Context) Close()

Close 停止測試 釋放資源

func (*Context) CloseSend

func (s *Context) CloseSend()

CloseSend 關閉 生產者

func (*Context) Get

func (s *Context) Get() (result *Result)

Get 返回 響應數據

func (*Context) Run

func (s *Context) Run()

Run 運行 測試

func (*Context) Send

func (s *Context) Send(element *Element) (ok bool)

Send 投遞一個 測試項目

type Element

type Element struct {
	ID       uint64
	Outbound data.Outbound

Element .

type Result

type Result struct {
	Status   int    `json:"status,omitempty"`
	ID       uint64 `json:"id,omitempty"`
	Error    string `json:"error,omitempty"`
	Duration int64  `json:"duration,omitempty"`

Result 響應數據

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL