inmemory

package
v0.0.0-...-247c3a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Wishlists    map[wishlist.ID]*wishlist.Wishlist
	Items        map[wishlist.ID][]*wishlist.Item
	WishlistLock *sync.RWMutex
	ItemsLock    *sync.RWMutex
}

func NewWishlistInMemory

func NewWishlistInMemory() *Storage

func (*Storage) DeleteWishlistItem

func (s *Storage) DeleteWishlistItem(_ context.Context, itemID wishlist.ItemID) error

func (*Storage) Get

func (*Storage) GetByUserID

func (s *Storage) GetByUserID(_ context.Context, userID user.ID) ([]*wishlist.Wishlist, error)

func (*Storage) GetWishlistItemByID

func (s *Storage) GetWishlistItemByID(_ context.Context, itemID wishlist.ItemID) (*wishlist.Item, error)

func (*Storage) GetWishlistItems

func (s *Storage) GetWishlistItems(_ context.Context, wishlistID wishlist.ID, limit, offset uint) (items []*wishlist.Item, haveMore bool, err error)

func (*Storage) Upsert

func (s *Storage) Upsert(_ context.Context, w *wishlist.Wishlist) error

func (*Storage) UpsertWishlistItem

func (s *Storage) UpsertWishlistItem(_ context.Context, item *wishlist.Item) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL