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 ¶
FilterTags godoc @Summary Filter Tags @Description Filter Tags by query paramenters @Tags tags @Accept json @Produce json @Param name query string false "Tag name" @Param start query string false "Tag createdAt start date" @Param end query string false "Tag createdAt end date" @Success 200 {object} []DTO @Failure 400 @Failure 500 @Router /tags [get]
func (*API) FindOne ¶
FindOneTag godoc @Summary Find one an Tag @Description Find one Tag by ID @Tags tags @Accept json @Produce json @Param id path string true "Tag ID" @Success 200 {object} DTO @Failure 400 @Failure 404 @Failure 500 @Router /tags/{id} [get]
func (*API) Save ¶
SaveTag godoc @Summary Save Tag @Description Save a tag by giver form @Tags tags @Accept json @Produce json @Param tag body CreateDTO true "Add Tag" @Success 201 {object} DTO @Failure 500 @Router /tags [post]
func (*API) UpdateOne ¶
UpdateOneTag godoc @Summary Update one an Tag @Description Update one Tag by ID @Tags tags @Accept json @Produce json @Param id path string true "Tag ID" @Param tag body UpdateDTO true "Update Tag" @Success 200 {object} DTO @Failure 400 @Failure 404 @Failure 500 @Router /tags/{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