Documentation ¶
Index ¶
- func DecodeCreateRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeDeleteRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeGetByIDRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeSearchRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeUpdateRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
- func MakeCreateEndpoint(svc service.Service) endpoint.Endpoint
- func MakeDeleteEndpoint(svc service.Service) endpoint.Endpoint
- func MakeGetByIDEndpoint(svc service.Service) endpoint.Endpoint
- func MakeSearchEndpoint(svc service.Service) endpoint.Endpoint
- func MakeUpdateEndpoint(svc service.Service) endpoint.Endpoint
- func ParseIDFromURL(r *http.Request) (uint, error)
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type DeleteResponse
- type EndpointSet
- type GetByIDRequest
- type GetByIDResponse
- type SearchRequest
- type SearchResponse
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCreateRequest ¶
func DecodeDeleteRequest ¶
func DecodeGetByIDRequest ¶
func DecodeSearchRequest ¶
func DecodeUpdateRequest ¶
func EncodeResponse ¶
func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
Types ¶
type CreateRequest ¶
type CreateResponse ¶
type CreateResponse struct {
Message string `json:"message"`
}
type DeleteRequest ¶
type DeleteRequest struct {
ID uint `json:"id,omitempty"`
}
type DeleteResponse ¶
type DeleteResponse struct {
Message string `json:"message"`
}
type EndpointSet ¶
type EndpointSet struct { GetByIDEndpoint endpoint.Endpoint SearchEndpoint endpoint.Endpoint CreateEndpoint endpoint.Endpoint UpdateEndpoint endpoint.Endpoint DeleteEndpoint endpoint.Endpoint }
func NewEndpointSet ¶
func NewEndpointSet(svc service.Service) EndpointSet
type GetByIDRequest ¶
type GetByIDRequest struct {
ID uint `json:"id,omitempty"`
}
type GetByIDResponse ¶
type GetByIDResponse struct {
Product database.ProductOut `json:"product"`
}
type SearchRequest ¶
type SearchResponse ¶
type SearchResponse struct {
Products []database.ProductOut `json:"products"`
}
type UpdateRequest ¶
type UpdateResponse ¶
type UpdateResponse struct {
Message string `json:"message"`
}
Click to show internal directories.
Click to hide internal directories.