Versions in this module Expand all Collapse all v0 v0.1.0 Nov 9, 2026 Changes in this version + const MaxPageBytes + const MaxSettingsBytes + const OriginFile + const OriginSource + var ErrBadScope = errors.New("reader: the level must be global, source:<id> or work:<id>") + var ErrNoCopy = errors.New("reader: no copy of this chapter on a source you may use") + var ErrNotFound = errors.New("reader: not found") + var ErrNotImage = errors.New("reader: the page isn't a supported image") + var ErrPageNotFound = errors.New("reader: no such page") + var ErrTooLarge = fmt.Errorf("reader: settings larger than %d bytes", MaxSettingsBytes) + func Scope(sourceID string, workID *uuid.UUID) string + func ValidScope(scope string) error + type Files interface + Open func(ctx context.Context, chapterID uuid.UUID) (*downloads.File, error) + type HistoryItem struct + Chapter db.Chapter + Progress db.Progress + WorkCoverURL string + WorkTitle string + type HistoryQuery struct + PerSeries bool + Title string + WorkID uuid.UUID + type Page struct + Index int + type Pages struct + Chapter chapters.Chapter + Next *uuid.UUID + Origin string + Pages []Page + Prev *uuid.UUID + Progress *db.Progress + Variant chapters.VariantView + WorkID uuid.UUID + type ReadingStats struct + Chapters int64 + Continue *uuid.UUID + Downloaded int64 + LastReadAt *time.Time + LatestChapterAt *time.Time + Started bool + Unread int64 + type Service struct + func NewService(st *store.Store, host *plugins.Host, lib *library.Service, ...) *Service + func (s *Service) BookmarkCounts(ctx context.Context, userID uuid.UUID, workIDs []uuid.UUID) (map[uuid.UUID]int64, error) + func (s *Service) Bookmarks(ctx context.Context, userID, workID uuid.UUID) ([]uuid.UUID, error) + func (s *Service) ClearHistory(ctx context.Context, userID uuid.UUID) error + func (s *Service) DeleteSettings(ctx context.Context, userID uuid.UUID, scope string) error + func (s *Service) GetSettings(ctx context.Context, userID uuid.UUID, sourceID string, workID *uuid.UUID) (Settings, error) + func (s *Service) HideHistory(ctx context.Context, userID, workID uuid.UUID) error + func (s *Service) History(ctx context.Context, userID uuid.UUID, q HistoryQuery, before *db.Progress, ...) ([]HistoryItem, error) + func (s *Service) LibraryStats(ctx context.Context, userID uuid.UUID, workIDs []uuid.UUID) (map[uuid.UUID]ReadingStats, error) + func (s *Service) Locate(ctx context.Context, v library.Viewer, chapterID uuid.UUID) (db.Work, db.Chapter, error) + func (s *Service) MarkRead(ctx context.Context, v library.Viewer, workID uuid.UUID, ...) error + func (s *Service) Page(ctx context.Context, v library.Viewer, chapterID uuid.UUID, ...) (string, []byte, error) + func (s *Service) Pages(ctx context.Context, v library.Viewer, chapterID uuid.UUID, ...) (Pages, error) + func (s *Service) Preferences(ctx context.Context, userID uuid.UUID) (map[string]any, error) + func (s *Service) PutSettings(ctx context.Context, userID uuid.UUID, scope string, settings map[string]any) error + func (s *Service) SetBookmarks(ctx context.Context, v library.Viewer, workID uuid.UUID, ...) ([]uuid.UUID, error) + func (s *Service) SetFiles(f Files) + func (s *Service) SetPreferences(ctx context.Context, userID uuid.UUID, prefs map[string]any) error + func (s *Service) SetProgress(ctx context.Context, v library.Viewer, chapterID uuid.UUID, page int32, ...) (db.Progress, error) + func (s *Service) WorkProgress(ctx context.Context, v library.Viewer, workID uuid.UUID) ([]db.Progress, *uuid.UUID, error) + type Settings struct + Effective map[string]any + Global map[string]any + Source map[string]any + Work map[string]any