category

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 2 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Name     string `json:"name"`
	SavePath string `json:"save_path,omitempty" required:"false"`
}

Category represents a torrent category with an optional default save path, applied by Session.Add when the caller doesn't override.

type Service

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

Service manages torrent categories.

func NewService

func NewService(db *sql.DB) *Service

NewService creates a new category service.

func (*Service) Create

func (s *Service) Create(c Category) error

Create creates a new category.

func (*Service) Delete

func (s *Service) Delete(name string) error

Delete deletes a category. Torrents in this category are not removed.

func (*Service) Get

func (s *Service) Get(name string) (*Category, error)

Get returns a single category by name.

func (*Service) List

func (s *Service) List() ([]Category, error)

List returns all categories.

func (*Service) Update

func (s *Service) Update(name string, c Category) error

Update updates an existing category.

Jump to

Keyboard shortcuts

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