Documentation ¶
Index ¶
- func HandlerGetResourceID(fn func(*http.Request) string) func(*Handler)
- func HandlerGetResourceURI(fn func(string) string) func(*Handler)
- func HandlerParsePagination(fn func(r *http.Request) (*flare.Pagination, error)) func(*Handler)
- func HandlerRepository(repo flare.ResourceRepositorier) func(*Handler)
- func HandlerWriter(writer *infraHTTP.Writer) func(*Handler)
- type Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerGetResourceID ¶
HandlerGetResourceID set the function used to fetch the resourceID from the URL.
func HandlerGetResourceURI ¶
HandlerGetResourceURI set the function used to generate the URI for a resource.
func HandlerParsePagination ¶
HandlerParsePagination set the function used to parse the pagination.
func HandlerRepository ¶
func HandlerRepository(repo flare.ResourceRepositorier) func(*Handler)
HandlerRepository set the repository to access the resources.
func HandlerWriter ¶
HandlerWriter set the function that return the content to client.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements the HTTP handler to manage resources.
func NewHandler ¶
NewHandler initialize the service to handle HTTP requests.
func (*Handler) Create ¶
func (h *Handler) Create(w http.ResponseWriter, r *http.Request)
Create receive the request to create a resource.
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
Delete receive the request to delete a resource.
Click to show internal directories.
Click to hide internal directories.