Versions in this module Expand all Collapse all v1 v1.0.1 Sep 25, 2026 v1.0.0 Sep 25, 2026 Changes in this version + var ErrInvalidQueryOpts = errors.New("invalid query options") + var ErrNotFound = errors.New("data not found") + var ErrPermissionDenied = errors.New("permission denied") + func Delete[T any](repository Repository[T]) http.HandlerFunc + func GetAll[T any](repository Repository[T]) http.HandlerFunc + func Get[T any](repository Repository[T]) http.HandlerFunc + func Post[T any](repository Repository[T]) http.HandlerFunc + func Put[T any](repository Repository[T]) http.HandlerFunc + func RespondWithError(w http.ResponseWriter, code int, message string) error + func RespondWithJSON(w http.ResponseWriter, code int, payload any) error + type Controller struct + Repository Repository[T] + func (c *Controller[T]) Delete(w http.ResponseWriter, r *http.Request) + func (c *Controller[T]) Get(w http.ResponseWriter, r *http.Request) + func (c *Controller[T]) GetAll(w http.ResponseWriter, r *http.Request) + func (c *Controller[T]) Post(w http.ResponseWriter, r *http.Request) + func (c *Controller[T]) Put(w http.ResponseWriter, r *http.Request) + type Persistable interface + Delete func(ctx context.Context, ids ...string) error + Save func(ctx context.Context, entity *T) (string, error) + Update func(ctx context.Context, id string, entity T, fields ...string) error + type QueryOptions struct + Filters map[string]any + Max int + Offset int + Order string + Sort string + type Repository interface + Count func(context.Context, ...QueryOptions) (int64, error) + Read func(ctx context.Context, id string) (*T, error) + ReadAll func(context.Context, ...QueryOptions) ([]T, error) + type ValidationError struct + Errors map[string]string + func (m ValidationError) Error() string + func (m ValidationError) Is(target error) bool