Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/davemachado/public-api
/ functions
Functions
28 in github.com/davemachado/public-api
⨍
Functions
28
◇
Types & classes
7
↓ 4 callers
Method
WriteHeader
(status int)
logger.go:95
↓ 3 callers
Function
getEntriesHandler
getEntriesHandler returns an Entries object with the matching entries filtered by the search request
handlers.go:44
↓ 3 callers
Function
processSearchRequestToMatchingEntries
processSearchRequestToMatchingEntries decodes the request body into a SearchRequest struct that can be processed in a call to checkEntryMatches to ret
util.go:71
↓ 2 callers
Function
assertResponseValid
(t *testing.T, body *bytes.Buffer, expected []Entry)
handlers_test.go:26
↓ 2 callers
Function
checkEntryMatches
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 callers
Function
expect
(t *testing.T, a interface{}, b interface{})
logger_test.go:19
↓ 2 callers
Function
getCategoriesHandler
getCategoriesHandler returns a string slice object with all unique categories
handlers.go:69
↓ 2 callers
Function
getRandomHandler
getRandomHandler returns an Entries object containing a random element from the Entries slice
handlers.go:89
↓ 2 callers
Function
healthCheckHandler
healthCheckHandler returns a simple indication on whether or not the core http service is running
handlers.go:114
↓ 2 callers
Function
mockEntry
()
handlers_test.go:12
↓ 2 callers
Function
parseCategories
getCategories initializes a string slice containing all unique categories from a given slice of Entries
util.go:37
↓ 1 callers
Function
NewLogger
NewLogger returns a reference to a configured instance of Logger
logger.go:41
↓ 1 callers
Method
Write
(b []byte)
logger.go:100
↓ 1 callers
Function
encodeURL
(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
util.go:15
↓ 1 callers
Function
getList
getList initializes an Entries struct filled from the public-apis project
util.go:22
↓ 1 callers
Function
newCustomResponseWriter
(w http.ResponseWriter)
logger.go:106
Function
TestCheckEntryMatches
(t *testing.T)
util_test.go:51
Function
TestEncodeURL
(t *testing.T)
util_test.go:11
Function
TestGetCategories
(t *testing.T)
util_test.go:32
Function
TestGetCategoriesHandler
(t *testing.T)
handlers_test.go:57
Function
TestGetEntriesHandler
(t *testing.T)
handlers_test.go:101
Function
TestGetEntriesWithBadMethod
(t *testing.T)
handlers_test.go:117
Function
TestGetRandomHandler
(t *testing.T)
handlers_test.go:85
Function
TestHealthCheckHandler
(t *testing.T)
handlers_test.go:38
Function
TestNoConfig
(t *testing.T)
logger_test.go:25
Function
TestProcessSearchRequestToMatchingEntries
(t *testing.T)
util_test.go:107
Method
logFunc
(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
logger.go:74
Function
main
()
main.go:18