library

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: 9 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 library manages Pilot library records and their series counts.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("library not found")

ErrNotFound is returned when a library does not exist.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Name                    string
	RootPath                string
	DefaultQualityProfileID string
	NamingFormat            *string
	FolderFormat            *string
	MinFreeSpaceGB          int
	Tags                    []string
}

CreateRequest carries the fields needed to create a library.

type Library

type Library struct {
	ID                      string
	Name                    string
	RootPath                string
	DefaultQualityProfileID string
	NamingFormat            *string
	FolderFormat            *string
	MinFreeSpaceGB          int
	Tags                    []string
	CreatedAt               time.Time
	UpdatedAt               time.Time
}

Library is the domain representation of a library record.

type Service

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

Service manages library records.

func NewService

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

NewService creates a new Service backed by the given querier and event bus.

func (*Service) Create

func (s *Service) Create(ctx context.Context, req CreateRequest) (Library, error)

Create inserts a new library and returns the persisted domain type.

func (*Service) Delete

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

Delete removes a library by ID. Returns ErrNotFound if the library does not exist.

func (*Service) Get

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

Get returns a library by ID. Returns ErrNotFound if no library with that ID exists.

func (*Service) List

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

List returns all libraries ordered by name.

func (*Service) Stats

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

Stats returns runtime metrics for the library.

func (*Service) Update

func (s *Service) Update(ctx context.Context, id string, req UpdateRequest) (Library, error)

Update replaces the mutable fields of an existing library. Returns ErrNotFound if the library does not exist.

type Stats

type Stats struct {
	SeriesCount int64
}

Stats holds runtime metrics about a library.

type UpdateRequest

type UpdateRequest = CreateRequest

UpdateRequest carries the fields needed to update a library. It is identical in shape to CreateRequest.

Jump to

Keyboard shortcuts

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