Documentation ¶
Index ¶
- type API
- type CreateDTO
- type DTO
- type FindOptions
- type Model
- type Models
- type Repository
- func (r *Repository) All() ([]*Model, error)
- func (r *Repository) DeleteOne(id string) error
- func (r *Repository) Find(options FindOptions) ([]*Model, error)
- func (r *Repository) FindOne(id string) (*Model, error)
- func (r *Repository) Save(user *CreateDTO) (*Model, error)
- func (r *Repository) UpdateOne(id string, user *UpdateDTO) error
- type Router
- type Service
- func (s *Service) All() ([]*DTO, error)
- func (s *Service) DeleteOne(id string) error
- func (s *Service) Find(options FindOptions) ([]*DTO, error)
- func (s *Service) FindOne(id string) (*DTO, error)
- func (s *Service) Save(createDTO *CreateDTO) (*DTO, error)
- func (s *Service) UpdateOne(id string, updateDTO *UpdateDTO) (*DTO, error)
- type Tabler
- type UpdateDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Find ¶
FilterCollectors godoc @Summary Filter Collectors @Description Filter Collectors by query paramenters @Tags collectors @Accept json @Produce json @Param name query string false "Collector name" @Param start query string false "Collector createdAt start date" @Param end query string false "Collector createdAt end date" @Success 200 {object} []DTO @Failure 400 @Failure 500 @Router /collectors [get]
func (*API) FindOne ¶
FindOneCollector godoc @Summary Find one an Collector @Description Find one Collector by ID @Tags collectors @Accept json @Produce json @Param id path string true "Collector ID" @Success 200 {object} DTO @Failure 400 @Failure 404 @Failure 500 @Router /collectors/{id} [get]
func (*API) Save ¶
SaveCollector godoc @Summary Save Collector @Description Save a collector by giver form @Tags collectors @Accept json @Produce json @Param collector body CreateDTO true "Add Collector" @Success 201 {object} DTO @Failure 500 @Router /collectors [post]
func (*API) UpdateOne ¶
UpdateOneCollector godoc @Summary Update one an Collector @Description Update one Collector by ID @Tags collectors @Accept json @Produce json @Param id path string true "Collector ID" @Param collector body UpdateDTO true "Update Collector" @Success 200 {object} DTO @Failure 400 @Failure 404 @Failure 500 @Router /collectors/{id} [post]
type FindOptions ¶
type Model ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *gorm.DB, l *slog.Logger) *Repository
func (*Repository) All ¶
func (r *Repository) All() ([]*Model, error)
func (*Repository) DeleteOne ¶
func (r *Repository) DeleteOne(id string) error
func (*Repository) Find ¶
func (r *Repository) Find(options FindOptions) ([]*Model, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository *Repository, l *slog.Logger) *Service