api

package
v0.0.0-...-6eac626 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGetAllDataReq

func DecodeGetAllDataReq(_ context.Context, r *http.Request) (interface{}, error)

func DecodeGetFormattedStatsReq

func DecodeGetFormattedStatsReq(_ context.Context, r *http.Request) (interface{}, error)

func DecodeGetStatsByDateRangeReq

func DecodeGetStatsByDateRangeReq(_ context.Context, r *http.Request) (interface{}, error)

func DecodeGetStatsByDateReq

func DecodeGetStatsByDateReq(_ context.Context, r *http.Request) (interface{}, error)

func EncodeResponse

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

func MakeGetAllStatsEndpoint

func MakeGetAllStatsEndpoint(s Service) endpoint.Endpoint

func MakeGetFormattedStatsEndpoint

func MakeGetFormattedStatsEndpoint(s Service) endpoint.Endpoint

func MakeGetStatsByDateEndpoint

func MakeGetStatsByDateEndpoint(s Service) endpoint.Endpoint

func MakeGetStatsByDateRangeEndpoint

func MakeGetStatsByDateRangeEndpoint(s Service) endpoint.Endpoint

func MakeHTTPHandler

func MakeHTTPHandler(s Service) http.Handler

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

Jump to

Keyboard shortcuts

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