Documentation ¶
Overview ¶
Packave api provides functions which are used to serve the http Endpoints
Index ¶
- func GetPair(response http.ResponseWriter, request *http.Request)
- func GetRecords(response http.ResponseWriter, request *http.Request)
- func HandlePair(response http.ResponseWriter, request *http.Request)
- func InsertPair(response http.ResponseWriter, request *http.Request)
- type ErrorResponse
- type RecordRequest
- type RecordResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPair ¶
func GetPair(response http.ResponseWriter, request *http.Request)
GetPair fetches a key-value pair from in-memory database
func GetRecords ¶
func GetRecords(response http.ResponseWriter, request *http.Request)
GetRecords Rest Endpoint to fetches records from database
func HandlePair ¶
func HandlePair(response http.ResponseWriter, request *http.Request)
Handle Pair common REST endpoint for GetPair and InsertPair
func InsertPair ¶
func InsertPair(response http.ResponseWriter, request *http.Request)
InsertPairs creates a key-value entry in in-memory database
Types ¶
type ErrorResponse ¶
ErrorResponse to be sent back for any errors in the system
type RecordRequest ¶
type RecordRequest struct { StartDate string `validate:"required" json:"startdate"` EndDate string `validate:"required" json:"enddate"` MinCount int `validate:"required" json:"mincount"` MaxCount int `validate:"required" json:"maxcount"` }
Request representing GetRecords input structure, includes validation and json tags
Click to show internal directories.
Click to hide internal directories.