Documentation
¶
Index ¶
- func RegisterRoutesWithGroup(g *echo.Group, db *bun.DB, authMiddleware *auth.Middleware)
- type ListTagsOptions
- type ListTagsQuery
- type MergeTagsPayload
- type RetrieveTagOptions
- type Service
- func (svc *Service) CleanupOrphanedTags(ctx context.Context) (int, error)
- func (svc *Service) CreateTag(ctx context.Context, tag *models.Tag) error
- func (svc *Service) DeleteTag(ctx context.Context, tagID int) error
- func (svc *Service) FindOrCreateTag(ctx context.Context, name string, libraryID int) (*models.Tag, error)
- func (svc *Service) GetBookCount(ctx context.Context, tagID int) (int, error)
- func (svc *Service) GetBooks(ctx context.Context, tagID int) ([]*models.Book, error)
- func (svc *Service) ListTags(ctx context.Context, opts ListTagsOptions) ([]*models.Tag, error)
- func (svc *Service) ListTagsWithTotal(ctx context.Context, opts ListTagsOptions) ([]*models.Tag, int, error)
- func (svc *Service) MergeTags(ctx context.Context, targetID, sourceID int) error
- func (svc *Service) RetrieveTag(ctx context.Context, opts RetrieveTagOptions) (*models.Tag, error)
- func (svc *Service) UpdateTag(ctx context.Context, tag *models.Tag, opts UpdateTagOptions) error
- type UpdateTagOptions
- type UpdateTagPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutesWithGroup ¶
RegisterRoutesWithGroup registers tag routes on a pre-configured group.
Types ¶
type ListTagsOptions ¶
type ListTagsQuery ¶
type ListTagsQuery struct {
Limit int `query:"limit" json:"limit,omitempty" default:"24" validate:"min=1,max=50"`
Offset int `query:"offset" json:"offset,omitempty" validate:"min=0"`
LibraryID *int `query:"library_id" json:"library_id,omitempty" validate:"omitempty,min=1" tstype:"number"`
Search *string `query:"search" json:"search,omitempty" validate:"omitempty,max=100" tstype:"string"`
}
type MergeTagsPayload ¶
type MergeTagsPayload struct {
SourceID int `json:"source_id" validate:"required,min=1"`
}
type RetrieveTagOptions ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CleanupOrphanedTags ¶
CleanupOrphanedTags deletes tags with no book associations.
func (*Service) FindOrCreateTag ¶
func (svc *Service) FindOrCreateTag(ctx context.Context, name string, libraryID int) (*models.Tag, error)
FindOrCreateTag finds an existing tag or creates a new one (case-insensitive match).
func (*Service) GetBookCount ¶
GetBookCount returns the count of books with this tag.
func (*Service) ListTagsWithTotal ¶
func (*Service) MergeTags ¶
MergeTags merges sourceTag into targetTag (moves all associations, deletes source).
func (*Service) RetrieveTag ¶
type UpdateTagOptions ¶
type UpdateTagOptions struct {
Columns []string
}
type UpdateTagPayload ¶
type UpdateTagPayload struct {
Name *string `json:"name,omitempty" validate:"omitempty,min=1,max=300"`
}
Click to show internal directories.
Click to hide internal directories.