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 DecodeQuantityOrderedRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeSearchRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeTopRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeTotalRequest(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 MakeQuantityOrderedEndpoint(svc service.Service) endpoint.Endpoint
- func MakeSearchEndpoint(svc service.Service) endpoint.Endpoint
- func MakeTopEndpoint(svc service.Service) endpoint.Endpoint
- func MakeTotalEndpoint(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 QuantityOrderedRequest
- type QuantityOrderedResponse
- type SearchRequest
- type SearchResponse
- type TopRequest
- type TopResponse
- type TotalRequest
- type TotalResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCreateRequest ¶
func DecodeDeleteRequest ¶
func DecodeGetByIDRequest ¶
func DecodeSearchRequest ¶
func DecodeTopRequest ¶
func DecodeTotalRequest ¶
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 DeleteEndpoint endpoint.Endpoint TotalEndpoint endpoint.Endpoint TopEndpoint endpoint.Endpoint QuantityOrderedEndpoint 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 {
OrderItems []database.OrderItemOut `json:"orderItems"`
}
type QuantityOrderedRequest ¶
type QuantityOrderedRequest struct {
ID uint `json:"id"`
}
type QuantityOrderedResponse ¶
type QuantityOrderedResponse struct {
Quantity uint `json:"quantity"`
}
type SearchRequest ¶
type SearchResponse ¶
type TopRequest ¶
type TopRequest struct {
Count uint `json:"count"`
}
type TopResponse ¶
type TopResponse struct {
Products []database.ProductOutTop `json:"products"`
}
type TotalRequest ¶
type TotalRequest struct { }
type TotalResponse ¶
type TotalResponse struct {
Total float32 `json:"total"`
}
Click to show internal directories.
Click to hide internal directories.