mtp

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadMTProtoList

func DownloadMTProtoList(ctx context.Context, sources []string) ([]string, []string)

func LoadFromFile

func LoadFromFile(path string) ([]string, error)

func WriteHealthy

func WriteHealthy(path string, results []Result) error

Types

type Checker

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

func NewChecker

func NewChecker(cfg CheckerConfig) *Checker

func (*Checker) CheckManyRealtime

func (c *Checker) CheckManyRealtime(ctx context.Context, items []string, threads int, timeout time.Duration, noColor bool) ([]Result, error)

func (*Checker) Results

func (c *Checker) Results() []Result

func (*Checker) Run

func (c *Checker) Run() error

func (*Checker) Wait

func (c *Checker) Wait()

type CheckerConfig

type CheckerConfig struct {
	File       string
	Download   bool
	OutputFile string
	NoColor    bool
	Threads    int
	Timeout    time.Duration
	Sources    []string
}

type ProxyEntry

type ProxyEntry struct {
	Raw    string
	Server string
	Port   int
	Secret string
}

func ParseProxyLine

func ParseProxyLine(raw string) (ProxyEntry, error)

type Result

type Result struct {
	Entry   ProxyEntry
	Healthy bool
	Latency time.Duration
	Err     error
}

func CheckProxy

func CheckProxy(ctx context.Context, e ProxyEntry, timeout time.Duration) Result

Jump to

Keyboard shortcuts

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