Documentation
¶
Index ¶
- func RegisterRoutesWithGroup(g *echo.Group, db *bun.DB, authMiddleware *auth.Middleware, ...)
- type CreateLibraryPayload
- type LibraryResponse
- type ListLibrariesOptions
- type ListLibrariesQuery
- type ListLibrariesResponse
- type RegisterRoutesOptions
- type RetrieveLibraryOptions
- type Service
- func (svc *Service) CreateLibrary(ctx context.Context, library *models.Library) error
- func (svc *Service) DeleteLibrary(ctx context.Context, id int) error
- func (svc *Service) ListLibraries(ctx context.Context, opts ListLibrariesOptions) ([]*models.Library, error)
- func (svc *Service) ListLibrariesWithTotal(ctx context.Context, opts ListLibrariesOptions) ([]*models.Library, int, error)
- func (svc *Service) RetrieveLibrary(ctx context.Context, opts RetrieveLibraryOptions) (*models.Library, error)
- func (svc *Service) UpdateLibrary(ctx context.Context, library *models.Library, opts UpdateLibraryOptions) error
- type UpdateLibraryOptions
- type UpdateLibraryPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutesWithGroup ¶
func RegisterRoutesWithGroup(g *echo.Group, db *bun.DB, authMiddleware *auth.Middleware, opts ...RegisterRoutesOptions)
RegisterRoutesWithGroup registers library routes on a pre-configured group.
Types ¶
type CreateLibraryPayload ¶
type CreateLibraryPayload struct {
Name string `json:"name" validate:"required,max=100"`
OrganizeFileStructure *bool `json:"organize_file_structure,omitempty"`
CoverAspectRatio string `` /* 140-byte string literal not displayed */
DownloadFormatPreference *string `json:"download_format_preference,omitempty" validate:"omitempty,oneof=original kepub ask" tstype:"DownloadFormat"`
LibraryPaths []string `json:"library_paths" validate:"required,min=1,max=50,dive"`
}
type LibraryResponse ¶ added in v0.0.47
LibraryResponse is the single-library API response. It embeds the Library model by value so tygo emits `extends Library`; the wire format is identical to returning the bare model.
type ListLibrariesOptions ¶
type ListLibrariesQuery ¶
type ListLibrariesResponse ¶ added in v0.0.47
type ListLibrariesResponse struct {
Items []*models.Library `json:"items" tstype:"Library[]"`
Total int `json:"total"`
}
ListLibrariesResponse is the list-endpoint envelope.
type RegisterRoutesOptions ¶ added in v0.0.20
type RegisterRoutesOptions struct {
// OnLibraryChanged is called after a library is created, has its paths
// updated, or is deleted. Used by the monitor to refresh filesystem watches.
OnLibraryChanged func()
}
RegisterRoutesOptions configures optional behaviors for library routes.
type RetrieveLibraryOptions ¶
type RetrieveLibraryOptions struct {
ID *int
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CreateLibrary ¶
func (*Service) DeleteLibrary ¶ added in v0.0.37
DeleteLibrary hard-deletes a library and all of its DB-resident content. Files on disk are not touched. The operation runs in a single transaction:
- Cancel any pending/in-progress jobs scoped to this library.
- Purge FTS rows (books_fts, series_fts, persons_fts, genres_fts, tags_fts) for this library. FTS purge must happen before the CASCADE so rows are still resolvable.
- Delete the library row; SQLite cascades the rest.
Returns errcodes.NotFound if the library does not exist.
func (*Service) ListLibraries ¶
func (*Service) ListLibrariesWithTotal ¶
func (*Service) RetrieveLibrary ¶
func (*Service) UpdateLibrary ¶
type UpdateLibraryOptions ¶
type UpdateLibraryPayload ¶
type UpdateLibraryPayload struct {
Name *string `json:"name,omitempty" validate:"omitempty,max=100"`
OrganizeFileStructure *bool `json:"organize_file_structure,omitempty"`
CoverAspectRatio *string `` /* 151-byte string literal not displayed */
DownloadFormatPreference *string `json:"download_format_preference,omitempty" validate:"omitempty,oneof=original kepub ask" tstype:"DownloadFormat"`
LibraryPaths []string `json:"library_paths,omitempty" validate:"omitempty,min=1,max=50,dive"`
}
Click to show internal directories.
Click to hide internal directories.