Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound
Functions ¶
This section is empty.
Types ¶
type IDType ¶
type IDType interface { comparable }
type PageableRequest ¶
type PageableResponse ¶
type Repository ¶
type Repository[Id IDType, T any] interface { FindByID(ctx context.Context, id Id) (*T, error) FindOne(ctx context.Context, q query.Query) (*T, error) FindAll(ctx context.Context, q query.Query) ([]*T, error) Update(ctx context.Context, q query.Query, update any) error Save(ctx context.Context, t *T) (*T, error) SaveAll(ctx context.Context, ts []*T) error DeleteByID(ctx context.Context, id Id) error Delete(ctx context.Context, q query.Query) error ListPageable(ctx context.Context, q query.Query, req PageableRequest) (*PageableResponse[*T], error) ParseQuery(ctx context.Context, q query.Query) *gorm.DB Context(ctx context.Context) *gorm.DB }
func New ¶
func New[Id IDType, T any](gp orm.GormProvider) Repository[Id, T]
Click to show internal directories.
Click to hide internal directories.