Documentation ¶
Index ¶
- Variables
- type CRUDInteractor
- type DTO
- type DTOItem
- type Handler
- func (h *Handler) Create(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Step(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Steps(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Update(w http.ResponseWriter, r *http.Request)
- type Interactor
- type Repository
- type Step
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStepNotFound = errors.New("step not found") ErrStepNotCreated = errors.New("step not created") ErrStepNotDeleted = errors.New("step not deleted") ErrStepNotUpdated = errors.New("step not updated") ErrStepNameEmpty = errors.New("empty step name not allowed") ErrMessageEmpty = errors.New("message is required") )
Functions ¶
This section is empty.
Types ¶
type CRUDInteractor ¶
type CRUDInteractor struct {
// contains filtered or unexported fields
}
func NewUsecases ¶
func NewUsecases(repo Repository) *CRUDInteractor
func (CRUDInteractor) Delete ¶
func (i CRUDInteractor) Delete(id int) error
func (CRUDInteractor) GetRange ¶
func (i CRUDInteractor) GetRange(limit, offset int) ([]*Step, error)
func (CRUDInteractor) Update ¶
func (i CRUDInteractor) Update(newStep *Step) error
type DTO ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(interactor Interactor) *Handler
type Interactor ¶
type Repository ¶
type Repository interface { Find(id int) (*Step, error) FindRange(limit, offset int) ([]*Step, error) Store(newStep *Step) (int64, error) Remove(id int) error Update(newStep *Step) error }
func NewSQLRepository ¶
func NewSQLRepository(db sqlutil.SQLDatabase) Repository
Click to show internal directories.
Click to hide internal directories.