Documentation
¶
Index ¶
- type InMemoryPolyfeaRepository
- func (r *InMemoryPolyfeaRepository[ItemType]) DeleteItem(item ItemType) error
- func (r *InMemoryPolyfeaRepository[ItemType]) GetItem(item ItemType) (ItemType, error)
- func (r *InMemoryPolyfeaRepository[ItemType]) GetItems(filter PolyfeaRepositoryFilterFunc[ItemType]) ([]ItemType, error)
- func (r *InMemoryPolyfeaRepository[ItemType]) StoreItem(item ItemType) error
- type PolyfeaRepository
- type PolyfeaRepositoryFilterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryPolyfeaRepository ¶
type InMemoryPolyfeaRepository[ItemType interface{ GetName() string }] struct {
// contains filtered or unexported fields
}
func NewInMemoryPolyfeaRepository ¶
func NewInMemoryPolyfeaRepository[ItemType interface{ GetName() string }]() *InMemoryPolyfeaRepository[ItemType]
func (*InMemoryPolyfeaRepository[ItemType]) DeleteItem ¶
func (r *InMemoryPolyfeaRepository[ItemType]) DeleteItem(item ItemType) error
func (*InMemoryPolyfeaRepository[ItemType]) GetItem ¶ added in v0.1.3
func (r *InMemoryPolyfeaRepository[ItemType]) GetItem(item ItemType) (ItemType, error)
func (*InMemoryPolyfeaRepository[ItemType]) GetItems ¶
func (r *InMemoryPolyfeaRepository[ItemType]) GetItems(filter PolyfeaRepositoryFilterFunc[ItemType]) ([]ItemType, error)
func (*InMemoryPolyfeaRepository[ItemType]) StoreItem ¶
func (r *InMemoryPolyfeaRepository[ItemType]) StoreItem(item ItemType) error
type PolyfeaRepository ¶
type PolyfeaRepository[ItemType interface{ GetName() string }] interface {
StoreItem(item ItemType) error
GetItem(item ItemType) (ItemType, error)
GetItems(filter PolyfeaRepositoryFilterFunc[ItemType]) ([]ItemType, error)
DeleteItem(item ItemType) error
}
PolyfeaRepository is a generic interface for storing and retrieving items of type ItemType. The type ItemType must implement the GetName() method.
type PolyfeaRepositoryFilterFunc ¶
type PolyfeaRepositoryFilterFunc[ItemType interface{}] func(mf ItemType) bool
PolyfeaRepositoryFilterFunc is a function that takes an item of type ItemType and returns a boolean.
Click to show internal directories.
Click to hide internal directories.