Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataDomain ¶
type DataRepository ¶
type DataRepository[T GenericResource] interface { List(ctx context.Context, offset, limit int) (items []T, total int, err error) Search(ctx context.Context, text string, offset, limit int) (items []T, total int, err error) GetByID(ctx context.Context, id int) (item T, err error) Create(ctx context.Context, body T) (item T, err error) Update(ctx context.Context, body T) (err error) Delete(ctx context.Context, id int) (err error) }
type DataService ¶
type DataService[T GenericResource] interface { List(ctx context.Context, offset, limit int) (data *Pagination[T], err error) Search(ctx context.Context, text string, offset, limit int) (data *Pagination[T], err error) GetByID(ctx context.Context, id int) (item T, err error) Create(ctx context.Context, body T) (item T, err error) Update(ctx context.Context, body T) (err error) Delete(ctx context.Context, id int) (err error) }
type GenericResource ¶
type GenericResource interface { DataDomain }
type Pagination ¶
type ProductResource ¶
type ProductResource Product
func (*ProductResource) GetResource ¶
func (item *ProductResource) GetResource() string
func (*ProductResource) GetRoutePath ¶
func (item *ProductResource) GetRoutePath() string
Click to show internal directories.
Click to hide internal directories.