proxy

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBPathEnvName = "xtray_db_path"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *gorm.DB
}

func NewDB

func NewDB(dbPath string) (r *Database)

func StorageDB

func StorageDB() *Database

singleton pattern for db.

type Fetcher

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

func NewFetcher

func NewFetcher(c *conf.Conf) *Fetcher

func (*Fetcher) GetFile

func (that *Fetcher) GetFile()

type IProxy

type IProxy interface {
	GetRawUri() string
	SetRtt(rtt int)
}

type Proxy

type Proxy struct {
	RawUri string `gorm:"<-;index" koanf,json:"raw_uri"`
	RTT    int    `gorm:"<-" koanf,json:"rtt"`
}

func (*Proxy) AddProxy

func (that *Proxy) AddProxy(p *Proxy) (r Proxy, err error)

func (*Proxy) GetAll

func (that *Proxy) GetAll() (pList []*Proxy, err error)

func (*Proxy) GetRawUri

func (that *Proxy) GetRawUri() string

func (*Proxy) SetRtt

func (that *Proxy) SetRtt(rtt int)

func (*Proxy) TableName

func (that *Proxy) TableName() string

type VList

type VList struct {
	List       []*Proxy `koanf,json:"list"`
	UpdateTime string   `koanf,json:"update_time"`
	Total      int      `koanf,json:"total"`
}

type VerifiedList

type VerifiedList struct {
	VList *VList
	*utils.Koanfer
}

func NewVerifiedList

func NewVerifiedList(p string) *VerifiedList

func (*VerifiedList) GetByIndex

func (that *VerifiedList) GetByIndex(idx int) (p string)

func (*VerifiedList) Load

func (that *VerifiedList) Load()

func (*VerifiedList) Save

func (that *VerifiedList) Save()

func (*VerifiedList) SaveToStorage

func (that *VerifiedList) SaveToStorage()

type Verifier

type Verifier struct {
	RawProxies      *runner.Result
	VerifiedProxies *VerifiedList
	ProxyChan       chan IProxy
	IsRunning       bool
	// contains filtered or unexported fields
}

func NewVerifier

func NewVerifier(conf *conf.Conf) *Verifier

func (*Verifier) ExportHistory

func (that *Verifier) ExportHistory()

func (*Verifier) Reload

func (that *Verifier) Reload(force bool, useHistory bool)

func (*Verifier) Run

func (that *Verifier) Run(force bool, useHistory bool)

func (*Verifier) RunXClient

func (that *Verifier) RunXClient(port int)

Jump to

Keyboard shortcuts

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