MCPcopy Create free account

hub / github.com/davemachado/public-api / functions

Functions28 in github.com/davemachado/public-api

↓ 4 callersMethodWriteHeader
(status int)
logger.go:95
↓ 3 callersFunctiongetEntriesHandler
getEntriesHandler returns an Entries object with the matching entries filtered by the search request
handlers.go:44
↓ 3 callersFunctionprocessSearchRequestToMatchingEntries
processSearchRequestToMatchingEntries decodes the request body into a SearchRequest struct that can be processed in a call to checkEntryMatches to ret
util.go:71
↓ 2 callersFunctionassertResponseValid
(t *testing.T, body *bytes.Buffer, expected []Entry)
handlers_test.go:26
↓ 2 callersFunctioncheckEntryMatches
checkEntryMatches checks if the given entry matches the given request's parameters. it returns true if the entry matches, and returns false otherwise.
util.go:51
↓ 2 callersFunctionexpect
(t *testing.T, a interface{}, b interface{})
logger_test.go:19
↓ 2 callersFunctiongetCategoriesHandler
getCategoriesHandler returns a string slice object with all unique categories
handlers.go:69
↓ 2 callersFunctiongetRandomHandler
getRandomHandler returns an Entries object containing a random element from the Entries slice
handlers.go:89
↓ 2 callersFunctionhealthCheckHandler
healthCheckHandler returns a simple indication on whether or not the core http service is running
handlers.go:114
↓ 2 callersFunctionmockEntry
()
handlers_test.go:12
↓ 2 callersFunctionparseCategories
getCategories initializes a string slice containing all unique categories from a given slice of Entries
util.go:37
↓ 1 callersFunctionNewLogger
NewLogger returns a reference to a configured instance of Logger
logger.go:41
↓ 1 callersMethodWrite
(b []byte)
logger.go:100
↓ 1 callersFunctionencodeURL
(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
util.go:15
↓ 1 callersFunctiongetList
getList initializes an Entries struct filled from the public-apis project
util.go:22
↓ 1 callersFunctionnewCustomResponseWriter
(w http.ResponseWriter)
logger.go:106
FunctionTestCheckEntryMatches
(t *testing.T)
util_test.go:51
FunctionTestEncodeURL
(t *testing.T)
util_test.go:11
FunctionTestGetCategories
(t *testing.T)
util_test.go:32
FunctionTestGetCategoriesHandler
(t *testing.T)
handlers_test.go:57
FunctionTestGetEntriesHandler
(t *testing.T)
handlers_test.go:101
FunctionTestGetEntriesWithBadMethod
(t *testing.T)
handlers_test.go:117
FunctionTestGetRandomHandler
(t *testing.T)
handlers_test.go:85
FunctionTestHealthCheckHandler
(t *testing.T)
handlers_test.go:38
FunctionTestNoConfig
(t *testing.T)
logger_test.go:25
FunctionTestProcessSearchRequestToMatchingEntries
(t *testing.T)
util_test.go:107
MethodlogFunc
(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
logger.go:74
Functionmain
()
main.go:18