Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository[T any, K comparable] interface { // Save creates or updates an entity. Save(ctx context.Context, entity T) (T, error) // FindByID retrieves an entity by its ID. FindByID(ctx context.Context, id K) (T, error) // FindAll retrieves all entities. FindAll(ctx context.Context) ([]T, error) // DeleteByID deletes an entity by its ID. DeleteByID(ctx context.Context, id K) error // ExistsByID checks if an entity with the given ID exists. ExistsByID(ctx context.Context, id K) (bool, error) }
Repository is a generic interface for basic CRUD operations on an entity. T is the type of the entity, K is the type of the entity's ID.
Click to show internal directories.
Click to hide internal directories.