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) StepContact(w http.ResponseWriter, r *http.Request)
- func (h Handler) StepContacts(w http.ResponseWriter, r *http.Request)
- func (h Handler) Update(w http.ResponseWriter, r *http.Request)
- type Repo
- func (r *Repo) Find(stepID int, contact string) (*StepContact, error)
- func (r *Repo) FindRange(stepID, limit, offset int) ([]*StepContact, error)
- func (r *Repo) Remove(stepID int, cs ...string) error
- func (r *Repo) Store(scs ...*StepContact) error
- func (r *Repo) Update(prevContact string, sc *StepContact) error
- type Repository
- type StepContact
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CRUDInteractor ¶
type CRUDInteractor interface { Get(stepID int, contact string) (*StepContact, error) GetRange(stepID, limit, offset int) ([]*StepContact, error) Add(stepContacts ...*StepContact) error Delete(stepID int, contact string) error Update(prevContact string, new *StepContact) error }
func NewCRUDInteractor ¶
func NewCRUDInteractor(repo Repository) CRUDInteractor
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandlers ¶
func NewHandlers(usecases CRUDInteractor) *Handler
func (Handler) StepContact ¶
func (h Handler) StepContact(w http.ResponseWriter, r *http.Request)
func (Handler) StepContacts ¶
func (h Handler) StepContacts(w http.ResponseWriter, r *http.Request)
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func NewSQLRepository ¶
func NewSQLRepository(db sqlutil.SQLTxDatabase) *Repo
func (*Repo) FindRange ¶
func (r *Repo) FindRange(stepID, limit, offset int) ([]*StepContact, error)
func (*Repo) Store ¶
func (r *Repo) Store(scs ...*StepContact) error
type Repository ¶
type Repository interface { Find(stepID int, contact string) (*StepContact, error) FindRange(stepID, limit, offset int) ([]*StepContact, error) Store(new ...*StepContact) error Remove(stepID int, contacts ...string) error Update(prevContact string, new *StepContact) error }
Click to show internal directories.
Click to hide internal directories.