endpoints

package
v0.0.0-...-9af728f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCategoriesRequest

func DecodeCategoriesRequest(ctx context.Context, r *http.Request) (interface{}, error)

func DecodeCreateRequest

func DecodeCreateRequest(ctx context.Context, r *http.Request) (interface{}, error)

func DecodeDeleteRequest

func DecodeDeleteRequest(ctx context.Context, r *http.Request) (interface{}, error)

func DecodeGetAllRequest

func DecodeGetAllRequest(ctx context.Context, r *http.Request) (interface{}, error)

func DecodeGetByIDRequest

func DecodeGetByIDRequest(ctx context.Context, r *http.Request) (interface{}, error)

func DecodeUpdateRequest

func DecodeUpdateRequest(ctx context.Context, r *http.Request) (interface{}, error)

func EncodeResponse

func EncodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error

func MakeCategoriesEndpoint

func MakeCategoriesEndpoint(svc service.Service) endpoint.Endpoint

func MakeCreateEndpoint

func MakeCreateEndpoint(svc service.Service) endpoint.Endpoint

func MakeDeleteEndpoint

func MakeDeleteEndpoint(svc service.Service) endpoint.Endpoint

func MakeGetAllEndpoint

func MakeGetAllEndpoint(svc service.Service) endpoint.Endpoint

func MakeGetByIDEndpoint

func MakeGetByIDEndpoint(svc service.Service) endpoint.Endpoint

func MakeUpdateEndpoint

func MakeUpdateEndpoint(svc service.Service) endpoint.Endpoint

func ParseIDFromURL

func ParseIDFromURL(r *http.Request) (uint, 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 CreateRequest struct {
	Input database.GroupIn `json:"input"`
}

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 GetByIDResponse struct {
	Group database.GroupOut `json:"group"`
}

type UpdateRequest

type UpdateRequest struct {
	ID   uint             `json:"id,omitempty"`
	Data database.GroupIn `json:"data"`
}

type UpdateResponse

type UpdateResponse struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL