downloadclient

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLClientTestResult

type DLClientTestResult struct {
	Success  bool   `json:"success"`
	Message  string `json:"message"`
	Duration string `json:"duration"`
}

DLClientTestResult holds the outcome of a download client connectivity test.

type Input

type Input struct {
	Name      string `json:"name"`
	Kind      string `json:"kind"`     // qbittorrent, deluge, transmission, sabnzbd, nzbget
	Protocol  string `json:"protocol"` // torrent, usenet
	Enabled   bool   `json:"enabled"`
	Priority  int    `json:"priority"`
	Host      string `json:"host"`
	Port      int    `json:"port"`
	UseSSL    bool   `json:"use_ssl"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Category  string `json:"category"`
	Directory string `json:"directory"`
	Settings  string `json:"settings"`
}

Input is the data needed to create or update a download client.

type Service

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

Service manages download client configurations.

func NewService

func NewService(q db.Querier, bus *events.Bus, logger *slog.Logger) *Service

NewService creates a new download client service.

func (*Service) Create

func (s *Service) Create(ctx context.Context, input Input) (*db.DownloadClient, error)

Create adds a new download client.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id string) error

Delete removes a download client.

func (*Service) Get

func (s *Service) Get(ctx context.Context, id string) (*db.DownloadClient, error)

Get returns a single download client.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]db.DownloadClient, error)

List returns all download clients.

func (*Service) SetNotifier

func (s *Service) SetNotifier(fn ServiceNotifier)

SetNotifier sets the function called to notify services when download clients change.

func (*Service) Test

func (s *Service) Test(ctx context.Context, kind, host string, port int, useSSL bool) DLClientTestResult

Test checks connectivity to a download client.

func (*Service) Update

func (s *Service) Update(ctx context.Context, id string, input Input) (*db.DownloadClient, error)

Update modifies a download client.

type ServiceNotifier

type ServiceNotifier func(ctx context.Context, protocol string)

ServiceNotifier is called to notify services when download clients change.

Jump to

Keyboard shortcuts

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