MCPcopy Create free account

hub / github.com/ebosas/microservices / functions

Functions45 in github.com/ebosas/microservices

↓ 12 callersMethodClose
Close closes the Rabbit connection. All resources associated with the connection, including channels, will also be closed.
internal/rabbit/conn.go:35
↓ 12 callersFunctiongetEnv
(key string, defaultVal string)
internal/config/config.go:44
↓ 4 callersMethodDeclareTopicExchange
DeclareTopicExchange declares an exchange of type 'topic'.
internal/rabbit/exchange.go:4
↓ 4 callersFunctionGetConn
GetConn established a Rabbit connection.
internal/rabbit/conn.go:17
↓ 4 callersFunctionNew
New returns configuration variables from the environment. These are passed by Docker from the .env file.
internal/config/config.go:27
↓ 3 callersMethodStartConsumer
StartConsumer consumes messages from a Rabbit queue with a specified routing key and passes them to a supplied handler for processing. The queue is cr
internal/rabbit/consume.go:15
↓ 2 callersFunctionFormatDuration
FormatDuration formats duration from timestamp to now. Based in part on the javascript library date-fns: https://github.com/date-fns/date-fns/blob/mas
internal/timeutil/timeutil.go:12
↓ 2 callersFunctionGetCache
GetCache gets cached data from Redis.
internal/cache/cache.go:27
↓ 2 callersMethodPublish
Publish publishes a message to a Rabbit exchange using the main channel. For use in the main go routine.
internal/rabbit/publish.go:11
↓ 2 callersFunctionPublishInChannel
PublishInChannel publishes a message to a Rabbit exchange using a provided channel. For use in go routines.
internal/rabbit/publish.go:17
↓ 2 callersFunctionaddAlert
(msg: string)
web/react/src/home.tsx:28
↓ 2 callersFunctionhandleAPICache
handleAPICache handles API calls for cached messages.
cmd/server/api.go:13
↓ 2 callersFunctioninsertToDB
insertToDB inserts a Rabbit message into a Postgres database.
cmd/database/database.go:56
↓ 2 callersFunctionupdateRedis
updateRedis updates Redis with a new Rabbit message.
cmd/cache/cache.go:49
↓ 1 callersFunctionGetCacheJSON
GetCacheJSON marshals cached data into JSON, calls GetCache to get the Cache struct.
internal/cache/cache.go:65
↓ 1 callersMethodStartConsumerTemp
StartConsumerTemp consumes messages with a specified routing key and passes them to a supplied handler for processing. Creates a separate channel and
internal/rabbit/consume.go:59
↓ 1 callersFunctionhandleMessages
handleMessages handles the messages page.
cmd/server/server.go:74
↓ 1 callersFunctionhandleNotFound
handleNotFound handles 404
cmd/server/server.go:183
↓ 1 callersFunctionhandlePublishRabbit
handlePublishRabbit publishes a Websocket message to a Rabbit exchange with the the back-end and database routing keys. A Websocket reader only passes
cmd/server/server.go:169
↓ 1 callersFunctionhandleWebsocket
handleWebsocket starts two message readers (consumers), one consuming a Rabbit queue and another reading from a Websocket connection. Each consumer re
cmd/server/server.go:111
↓ 1 callersFunctionhandleWebsocketConn
handleWebsocketConn passes a Rabbit connection to the Websocket handler.
cmd/server/server.go:101
↓ 1 callersFunctionhandleWriteWebsocket
handleWriteWebsocket writes a Rabbit message to Websocket. A Rabbit consumer only passes a message. So, a Websocket connection is additionally passed
cmd/server/server.go:153
↓ 1 callersFunctionpublishInput
publishInput reads user input, marshals to json, and publishes to a Rabbit exchange with the front-end and database routing keys.
cmd/backend/backend.go:56
↓ 1 callersFunctionsendMessage
(message: string)
web/react/src/home.tsx:11
↓ 1 callersFunctiontestArguments
testArguments produces arguments for the function being tested
cmd/cache/cache_test.go:59
↓ 1 callersFunctiontestArguments
testArguments produces arguments for the function being tested
cmd/database/database_test.go:46
↓ 1 callersFunctiontestUpdateRedis
testUpdateRedis inserts a marshalled message into mock redis
cmd/server/api_test.go:52
FunctionAlert
({alert}: alertProps)
web/react/src/alert.tsx:8
FunctionApp
()
web/react/src/app.tsx:12
FunctionForm
({sendMessage}: formProps)
web/react/src/form.tsx:7
FunctionHome
()
web/react/src/home.tsx:6
FunctionMessages
()
web/react/src/messages.tsx:10
FunctionStartReader
StartReader reads messages from a Websocket connection and passes them to a supplied handler for processing.
internal/websocket/read.go:11
FunctionTestAPICache
TestAPICache tests the cache API
cmd/server/api_test.go:23
FunctionTestFormatDuration
TestFormatDuration tests duration formatting
internal/timeutil/timeutil_test.go:9
FunctionTestInsertToDB
TestInsertToDB tests a message insertion into a database
cmd/database/database_test.go:15
FunctionTestUpdateRedis
TestUpdateRedis tests a message insertion into cache
cmd/cache/cache_test.go:17
FunctionhandleHome
handleHome handles the home page.
cmd/server/server.go:64
Functionmain
()
cmd/cache/cache.go:18
Functionmain
()
cmd/database/database.go:19
Functionmain
()
cmd/backend/backend.go:20
Functionmain
()
cmd/server/server.go:33
FunctionprintMessages
printMessages prints messages to stdout.
cmd/backend/backend.go:42
MethodsendMessage
(s: string)
web/react/src/form.tsx:4
FunctionsubmitMessage
(e: React.FormEvent<HTMLFormElement>)
web/react/src/form.tsx:10