Documentation
¶
Index ¶
- func DecodeGetAllDataReq(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeGetFormattedStatsReq(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeGetStatsByDateRangeReq(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeGetStatsByDateReq(_ context.Context, r *http.Request) (interface{}, error)
- func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) (err error)
- func MakeGetAllStatsEndpoint(s Service) endpoint.Endpoint
- func MakeGetFormattedStatsEndpoint(s Service) endpoint.Endpoint
- func MakeGetStatsByDateEndpoint(s Service) endpoint.Endpoint
- func MakeGetStatsByDateRangeEndpoint(s Service) endpoint.Endpoint
- func MakeHTTPHandler(s Service) http.Handler
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGetAllDataReq ¶
func DecodeGetStatsByDateReq ¶
func EncodeResponse ¶
func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) (err error)
func MakeGetAllStatsEndpoint ¶
func MakeHTTPHandler ¶
Types ¶
type Service ¶
type Service interface { FetchAllData() (model.Covid19StatMapDateWise, error) FetchByDate(date string) (model.Covid19StatMap, error) FetchByDateRange(from string, to string) (model.Covid19StatMapDateWise, error) FetchByDateRangeFormated(from time.Time, to time.Time) (model.FormatedStatResult, error) }
func NewService ¶
func NewService() Service
Click to show internal directories.
Click to hide internal directories.