tracker

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfg Config) error

func Loaded

func Loaded() int

Types

type BHD

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

func NewBHD

func NewBHD(c BHDConfig) *BHD

func (*BHD) Check

func (c *BHD) Check(host string) bool

func (*BHD) IsTrackerDown

func (c *BHD) IsTrackerDown(_ *Torrent) (error, bool)

func (*BHD) IsUnregistered

func (c *BHD) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*BHD) Name

func (c *BHD) Name() string

type BHDConfig

type BHDConfig struct {
	Key string `koanf:"api_key"`
}

type BTN

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

func NewBTN

func NewBTN(c BTNConfig) *BTN

func (*BTN) Check

func (c *BTN) Check(host string) bool

func (*BTN) IsTrackerDown

func (c *BTN) IsTrackerDown(_ *Torrent) (error, bool)

func (*BTN) IsUnregistered

func (c *BTN) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*BTN) Name

func (c *BTN) Name() string

type BTNConfig

type BTNConfig struct {
	Key string `koanf:"api_key"`
}

type Config

type Config struct {
	BHD    BHDConfig
	BTN    BTNConfig
	PTP    PTPConfig
	HDB    HDBConfig
	RED    REDConfig
	OPS    OPSConfig
	UNIT3D map[string]UNIT3DConfig
}

type HDB

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

func NewHDB

func NewHDB(c HDBConfig) *HDB

func (*HDB) Check

func (c *HDB) Check(host string) bool

func (*HDB) IsTrackerDown

func (c *HDB) IsTrackerDown(_ *Torrent) (error, bool)

func (*HDB) IsUnregistered

func (c *HDB) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*HDB) Name

func (c *HDB) Name() string

type HDBConfig

type HDBConfig struct {
	Username string `koanf:"username"`
	Passkey  string `koanf:"passkey"`
}

type Interface

type Interface interface {
	Name() string
	Check(host string) bool
	IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)
	IsTrackerDown(torrent *Torrent) (error, bool)
}

func Get

func Get(host string) Interface

type OPS

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

func NewOPS

func NewOPS(c OPSConfig) *OPS

func (*OPS) Check

func (c *OPS) Check(host string) bool

func (*OPS) IsTrackerDown

func (c *OPS) IsTrackerDown(_ *Torrent) (error, bool)

func (*OPS) IsUnregistered

func (c *OPS) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*OPS) Name

func (c *OPS) Name() string

type OPSConfig

type OPSConfig struct {
	Key string `koanf:"api_key"`
}

type PTP

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

func NewPTP

func NewPTP(c PTPConfig) *PTP

func (*PTP) Check

func (c *PTP) Check(host string) bool

func (*PTP) IsTrackerDown

func (c *PTP) IsTrackerDown(_ *Torrent) (error, bool)

func (*PTP) IsUnregistered

func (c *PTP) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*PTP) Name

func (c *PTP) Name() string

type PTPConfig

type PTPConfig struct {
	User string `koanf:"api_user"`
	Key  string `koanf:"api_key"`
}

type RED

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

func NewRED

func NewRED(c REDConfig) *RED

func (*RED) Check

func (c *RED) Check(host string) bool

func (*RED) IsTrackerDown

func (c *RED) IsTrackerDown(_ *Torrent) (error, bool)

func (*RED) IsUnregistered

func (c *RED) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*RED) Name

func (c *RED) Name() string

type REDConfig

type REDConfig struct {
	Key string `koanf:"api_key"`
}

type Torrent

type Torrent struct {
	// torrent
	Hash            string `json:"Hash"`
	Name            string `json:"Name"`
	TotalBytes      int64  `json:"TotalBytes"`
	DownloadedBytes int64  `json:"DownloadedBytes"`
	State           string `json:"State"`
	Downloaded      bool   `json:"Downloaded"`
	Seeding         bool   `json:"Seeding"`

	// tracker
	TrackerName   string
	TrackerStatus string
	Comment       string

	// internal
	APIDividerPrinted bool
}

type UNIT3D

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

func (*UNIT3D) Check

func (c *UNIT3D) Check(host string) bool

func (*UNIT3D) IsTrackerDown

func (c *UNIT3D) IsTrackerDown(_ *Torrent) (error, bool)

func (*UNIT3D) IsUnregistered

func (c *UNIT3D) IsUnregistered(ctx context.Context, torrent *Torrent) (error, bool)

func (*UNIT3D) Name

func (c *UNIT3D) Name() string

type UNIT3DConfig

type UNIT3DConfig struct {
	APIKey string `koanf:"api_key"`
	Domain string `koanf:"domain"`
}

Jump to

Keyboard shortcuts

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