Documentation
¶
Index ¶
- Variables
- func IsInvalidIDFormat(err error) bool
- func IsInvalidUserIDFormat(err error) bool
- func IsLikeCreationFailed(err error) bool
- func IsLikeDeletionFailed(err error) bool
- func IsLikeNotFound(err error) bool
- func IsLikeUpdateFailed(err error) bool
- type Store
- func (s *Store) Create(ctx context.Context, newLike like.Like) (like.Like, error)
- func (s *Store) DeleteByID(ctx context.Context, likeID string) error
- func (s *Store) QueryAllByPostID(ctx context.Context, postID string) ([]like.Like, error)
- func (s *Store) QueryAllByUserID(ctx context.Context, userID string) ([]like.Like, error)
- func (s *Store) QueryByID(ctx context.Context, likeID string) (like.Like, error)
- func (s *Store) Update(ctx context.Context, updatedLike like.Like) (like.Like, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidIDFormat = fmt.Errorf("invalid ID format") ErrLikeCreationFailed = fmt.Errorf("like creation failed") ErrLikeNotFound = fmt.Errorf("like not found") ErrLikeQueryFailed = fmt.Errorf("failed to query Like by ID") ErrLikeUpdateFailed = fmt.Errorf("like update failed") ErrLikeDeletionFailed = fmt.Errorf("like deletion failed") ErrInvalidUserIDFormat = fmt.Errorf("invalid User ID format") )
Custom errors for Like operations
Functions ¶
func IsInvalidIDFormat ¶
IsInvalidIDFormat checks if an error is due to invalid ID format.
func IsInvalidUserIDFormat ¶
IsInvalidUserIDFormat checks if an error is due to invalid User ID format.
func IsLikeCreationFailed ¶
IsLikeCreationFailed checks if an error is due to like creation failure.
func IsLikeDeletionFailed ¶
IsLikeDeletionFailed checks if an error is due to like deletion failure.
func IsLikeNotFound ¶
IsLikeNotFound checks if an error is due to a like not being found.
func IsLikeUpdateFailed ¶
IsLikeUpdateFailed checks if an error is due to like update failure.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteByID ¶
DeleteByID removes a Like document by its ID.
func (*Store) QueryAllByPostID ¶
QueryAllByPostID retrieves all Like documents for a specific post.
func (*Store) QueryAllByUserID ¶
QueryAllByUserID retrieves all Like documents for a specific user.
Click to show internal directories.
Click to hide internal directories.