Documentation ¶
Index ¶
- type Service
- func (srv *Service) Delete(path string, f func(w http.ResponseWriter, r *http.Request))
- func (srv *Service) Get(path string, f func(w http.ResponseWriter, r *http.Request))
- func (srv *Service) Post(path string, f func(w http.ResponseWriter, r *http.Request))
- func (srv *Service) Put(path string, f func(w http.ResponseWriter, r *http.Request))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { // Router is the router to be used by the handlers. Router *mux.Router // DB is the database to be used by the handlers. DB *gorm.DB // Logger is the logger to be used by the handlers. Logger *support.Logger }
Service represents the service with fields to be injected into the handlers.
func NewService ¶
NewService returns a new service instance. It expects the service to be used in a HTTP server.
func (*Service) Get ¶
Get routes for GET requests of a defined path, the handle function and accepts a query parameter called "q". For large datasets, is a good practice use query parameter called "page", "limit" and "offset".
Click to show internal directories.
Click to hide internal directories.