Documentation
¶
Index ¶
- func DecodeCategoriesRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeCreateRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeDeleteRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeGetAllRequest(ctx context.Context, r *http.Request) (interface{}, error)
- func DecodeGetByIDRequest(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 MakeCategoriesEndpoint(svc service.Service) endpoint.Endpoint
- func MakeCreateEndpoint(svc service.Service) endpoint.Endpoint
- func MakeDeleteEndpoint(svc service.Service) endpoint.Endpoint
- func MakeGetAllEndpoint(svc service.Service) endpoint.Endpoint
- func MakeGetByIDEndpoint(svc service.Service) endpoint.Endpoint
- func MakeUpdateEndpoint(svc service.Service) endpoint.Endpoint
- func ParseIDFromURL(r *http.Request) (uint, error)
- type CategoriesRequest
- type CategoriesResponse
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type DeleteResponse
- type EndpointSet
- type GetAllRequest
- type GetAllResponse
- type GetByIDRequest
- type GetByIDResponse
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCategoriesRequest ¶
func DecodeCreateRequest ¶
func DecodeDeleteRequest ¶
func DecodeGetAllRequest ¶
func DecodeGetByIDRequest ¶
func DecodeUpdateRequest ¶
func EncodeResponse ¶
func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error
Types ¶
type CategoriesRequest ¶
type CategoriesRequest struct {
ID uint `json:"id,omitempty"`
}
type CategoriesResponse ¶
type CategoriesResponse struct {
Categories []database.CategoryOut `json:"categories"`
}
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 { GetAllEndpoint endpoint.Endpoint CreateEndpoint endpoint.Endpoint UpdateEndpoint endpoint.Endpoint DeleteEndpoint endpoint.Endpoint CategoriesEndpoint endpoint.Endpoint GetByIDEndpoint endpoint.Endpoint }
func NewEndpointSet ¶
func NewEndpointSet(svc service.Service) EndpointSet
type GetAllRequest ¶
type GetAllRequest struct { }
type GetAllResponse ¶
type GetAllResponse struct {
Groups []database.GroupOutWithCategories `json:"groups"`
}
type GetByIDRequest ¶
type GetByIDRequest struct {
ID uint `json:"id,omitempty"`
}
type GetByIDResponse ¶
type UpdateRequest ¶
type UpdateResponse ¶
type UpdateResponse struct {
Message string `json:"message"`
}
Click to show internal directories.
Click to hide internal directories.