Versions in this module Expand all Collapse all v0 v0.6.0 Jun 30, 2023 Changes in this version + const SortDirectionKeyAscending + const SortDirectionKeyDescending + const SortKeyCreated + const SortKeyUpdated + var ErrEmptyAssetID = errors.New("star is not related to any asset") + var ErrEmptyUserID = errors.New("star is not related to any user") + type DuplicateRecordError struct + AssetID string + UserID string + func (e DuplicateRecordError) Error() string + type Filter struct + Offset int + Size int + Sort string + SortDirection string + type InvalidError struct + AssetID string + UserID string + func (e InvalidError) Error() string + type NotFoundError struct + AssetID string + UserID string + func (e NotFoundError) Error() string + type Repository interface + Create func(ctx context.Context, ns *namespace.Namespace, userID string, assetID string) (string, error) + Delete func(ctx context.Context, userID string, assetID string) error + GetAllAssetsByUserID func(ctx context.Context, flt Filter, userID string) ([]asset.Asset, error) + GetAssetByUserID func(ctx context.Context, userID string, assetID string) (asset.Asset, error) + GetStargazers func(ctx context.Context, flt Filter, assetID string) ([]user.User, error) + type Service struct + func NewService(starRepository Repository) *Service + func (s *Service) GetStargazers(ctx context.Context, flt Filter, assetID string) ([]user.User, error) + func (s *Service) GetStarredAssetByUserID(ctx context.Context, userID, assetID string) (asset.Asset, error) + func (s *Service) GetStarredAssetsByUserID(ctx context.Context, flt Filter, userID string) ([]asset.Asset, error) + func (s *Service) Stars(ctx context.Context, ns *namespace.Namespace, userID, assetID string) (string, error) + func (s *Service) Unstars(ctx context.Context, userID, assetID string) error + type UserNotFoundError struct + UserID string + func (e UserNotFoundError) Error() string