downloadhandling

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package downloadhandling provides access to download handling settings (completed/failed download automation, check interval, remote path mappings).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RemotePathMapping

type RemotePathMapping struct {
	ID         string
	Host       string
	RemotePath string
	LocalPath  string
}

RemotePathMapping is the application-level view of a remote_path_mappings row.

type Service

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

Service exposes read/write access to download handling settings and remote path mapping CRUD.

func NewService

func NewService(q dbgen.Querier) *Service

NewService creates a new Service backed by the given Querier.

func (*Service) CheckInterval

func (s *Service) CheckInterval(ctx context.Context) (time.Duration, error)

CheckInterval returns the polling interval as a time.Duration. Falls back to 60 seconds if the stored value is <= 0.

func (*Service) CreateRemotePathMapping

func (s *Service) CreateRemotePathMapping(ctx context.Context, host, remotePath, localPath string) (RemotePathMapping, error)

CreateRemotePathMapping inserts a new remote path mapping and returns it.

func (*Service) DeleteRemotePathMapping

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

DeleteRemotePathMapping removes a remote path mapping by ID.

func (*Service) Get

func (s *Service) Get(ctx context.Context) (Settings, error)

Get returns the current download handling settings.

func (*Service) ListRemotePathMappings

func (s *Service) ListRemotePathMappings(ctx context.Context) ([]RemotePathMapping, error)

ListRemotePathMappings returns all configured remote path mappings.

func (*Service) Update

func (s *Service) Update(ctx context.Context, settings Settings) (Settings, error)

Update persists new settings and returns the saved values.

type Settings

type Settings struct {
	EnableCompleted             bool
	CheckIntervalMinutes        int64
	RedownloadFailed            bool
	RedownloadFailedInteractive bool
}

Settings is the application-level view of the download_handling table.

Jump to

Keyboard shortcuts

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