Documentation
¶
Index ¶
- func RegisterRoutesWithGroup(g *echo.Group, db *bun.DB, _ *auth.Middleware)
- type AddBooksOptions
- type AddBooksPayload
- type CheckVisibilityQuery
- type CreateFromTemplatePayload
- type CreateListOptions
- type CreateListPayload
- type CreateShareOptions
- type CreateSharePayload
- type ListBooksOptions
- type ListBooksQuery
- type ListListsOptions
- type ListListsQuery
- type MoveBookPositionPayload
- type RemoveBooksOptions
- type RemoveBooksPayload
- type ReorderBooksOptions
- type ReorderBooksPayload
- type RetrieveListOptions
- type Service
- func (svc *Service) AddBooks(ctx context.Context, opts AddBooksOptions) error
- func (svc *Service) CanEdit(ctx context.Context, listID, userID int) (bool, error)
- func (svc *Service) CanManage(ctx context.Context, listID, userID int) (bool, error)
- func (svc *Service) CanView(ctx context.Context, listID, userID int) (bool, error)
- func (svc *Service) CheckBookVisibility(ctx context.Context, listID int, targetUserLibraryIDs []int) (visible, total int, err error)
- func (svc *Service) CreateList(ctx context.Context, opts CreateListOptions) (*models.List, error)
- func (svc *Service) CreateShare(ctx context.Context, opts CreateShareOptions) (*models.ListShare, error)
- func (svc *Service) DeleteList(ctx context.Context, listID int) error
- func (svc *Service) DeleteShare(ctx context.Context, shareID int) error
- func (svc *Service) GetBookLists(ctx context.Context, bookID, userID int) ([]*models.List, error)
- func (svc *Service) GetListBookCount(ctx context.Context, listID int, libraryIDs []int) (int, error)
- func (svc *Service) HasShare(ctx context.Context, listID, userID int) (bool, error)
- func (svc *Service) IsOwner(ctx context.Context, listID, userID int) (bool, error)
- func (svc *Service) ListBooks(ctx context.Context, opts ListBooksOptions) ([]*models.ListBook, error)
- func (svc *Service) ListBooksWithTotal(ctx context.Context, opts ListBooksOptions) ([]*models.ListBook, int, error)
- func (svc *Service) ListLists(ctx context.Context, opts ListListsOptions) ([]*models.List, error)
- func (svc *Service) ListListsWithTotal(ctx context.Context, opts ListListsOptions) ([]*models.List, int, error)
- func (svc *Service) ListShares(ctx context.Context, listID int) ([]*models.ListShare, error)
- func (svc *Service) MoveBookToPosition(ctx context.Context, listID, bookID, position int) error
- func (svc *Service) RemoveBooks(ctx context.Context, opts RemoveBooksOptions) error
- func (svc *Service) ReorderBooks(ctx context.Context, opts ReorderBooksOptions) error
- func (svc *Service) RetrieveList(ctx context.Context, opts RetrieveListOptions) (*models.List, error)
- func (svc *Service) UpdateBookListMemberships(ctx context.Context, bookID, userID int, listIDs []int) error
- func (svc *Service) UpdateList(ctx context.Context, list *models.List, opts UpdateListOptions) error
- func (svc *Service) UpdateShare(ctx context.Context, shareID int, permission string) error
- type UpdateBookListsPayload
- type UpdateListOptions
- type UpdateListPayload
- type UpdateSharePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutesWithGroup ¶
RegisterRoutesWithGroup registers lists routes on a pre-configured group.
Types ¶
type AddBooksOptions ¶
type AddBooksPayload ¶
type AddBooksPayload struct {
BookIDs []int `json:"book_ids" validate:"required,min=1,max=500,dive,min=1"`
}
type CheckVisibilityQuery ¶
type CheckVisibilityQuery struct {
UserID int `query:"user_id" json:"user_id" validate:"required,min=1" tstype:"number"`
}
type CreateFromTemplatePayload ¶
type CreateFromTemplatePayload struct {
}
type CreateListOptions ¶
type CreateListPayload ¶
type CreateListPayload struct {
Name string `json:"name" validate:"required,min=1,max=200"`
Description *string `json:"description,omitempty" validate:"omitempty,max=2000" tstype:"string"`
IsOrdered bool `json:"is_ordered"`
DefaultSort *string `` /* 150-byte string literal not displayed */
}
Payloads for create/update endpoints.
type CreateShareOptions ¶
type CreateShareOptions struct {
}
type CreateSharePayload ¶
type CreateSharePayload struct {
}
type ListBooksOptions ¶
type ListBooksQuery ¶
type ListListsOptions ¶
type ListListsQuery ¶
type ListListsQuery struct {
Limit int `query:"limit" json:"limit,omitempty" default:"50" validate:"min=1,max=100"`
Offset int `query:"offset" json:"offset,omitempty" validate:"min=0"`
}
Query params for list endpoints.
type MoveBookPositionPayload ¶
type MoveBookPositionPayload struct {
Position int `json:"position" validate:"required,min=1"`
}
type RemoveBooksOptions ¶
type RemoveBooksPayload ¶
type RemoveBooksPayload struct {
BookIDs []int `json:"book_ids" validate:"required,min=1,max=500,dive,min=1"`
}
type ReorderBooksOptions ¶
type ReorderBooksPayload ¶
type ReorderBooksPayload struct {
BookIDs []int `json:"book_ids" validate:"required,min=1,max=500,dive,min=1"`
}
type RetrieveListOptions ¶
type RetrieveListOptions struct {
ID *int
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddBooks ¶
func (svc *Service) AddBooks(ctx context.Context, opts AddBooksOptions) error
func (*Service) CheckBookVisibility ¶
func (svc *Service) CheckBookVisibility(ctx context.Context, listID int, targetUserLibraryIDs []int) (visible, total int, err error)
CheckBookVisibility returns counts of visible/total books for a user.
func (*Service) CreateList ¶
func (*Service) CreateShare ¶
func (*Service) DeleteShare ¶
func (*Service) GetBookLists ¶
GetBookLists returns lists that contain a specific book (for the user).
func (*Service) GetListBookCount ¶
func (svc *Service) GetListBookCount(ctx context.Context, listID int, libraryIDs []int) (int, error)
GetListBookCount returns the number of books in a list visible to the user.
func (*Service) ListBooksWithTotal ¶
func (*Service) ListListsWithTotal ¶
func (*Service) ListShares ¶
func (*Service) MoveBookToPosition ¶
MoveBookToPosition moves a book to a specific position within an ordered list.
func (*Service) RemoveBooks ¶
func (svc *Service) RemoveBooks(ctx context.Context, opts RemoveBooksOptions) error
func (*Service) ReorderBooks ¶
func (svc *Service) ReorderBooks(ctx context.Context, opts ReorderBooksOptions) error
func (*Service) RetrieveList ¶
func (*Service) UpdateBookListMemberships ¶
func (svc *Service) UpdateBookListMemberships(ctx context.Context, bookID, userID int, listIDs []int) error
UpdateBookListMemberships replaces which lists a book belongs to. Only modifies lists the user can edit.
func (*Service) UpdateList ¶
type UpdateBookListsPayload ¶
type UpdateBookListsPayload struct {
ListIDs []int `json:"list_ids" validate:"dive,min=1"`
}
type UpdateListOptions ¶
type UpdateListOptions struct {
Columns []string
}
type UpdateListPayload ¶
type UpdateListPayload struct {
Name *string `json:"name,omitempty" validate:"omitempty,min=1,max=200" tstype:"string"`
Description *string `json:"description,omitempty" validate:"omitempty,max=2000" tstype:"string"`
IsOrdered *bool `json:"is_ordered,omitempty" tstype:"boolean"`
DefaultSort *string `` /* 150-byte string literal not displayed */
}
type UpdateSharePayload ¶
type UpdateSharePayload struct {
}
Click to show internal directories.
Click to hide internal directories.