Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ebosas/microservices
/ functions
Functions
45 in github.com/ebosas/microservices
⨍
Functions
45
◇
Types & classes
11
↓ 12 callers
Method
Close
Close closes the Rabbit connection. All resources associated with the connection, including channels, will also be closed.
internal/rabbit/conn.go:35
↓ 12 callers
Function
getEnv
(key string, defaultVal string)
internal/config/config.go:44
↓ 4 callers
Method
DeclareTopicExchange
DeclareTopicExchange declares an exchange of type 'topic'.
internal/rabbit/exchange.go:4
↓ 4 callers
Function
GetConn
GetConn established a Rabbit connection.
internal/rabbit/conn.go:17
↓ 4 callers
Function
New
New returns configuration variables from the environment. These are passed by Docker from the .env file.
internal/config/config.go:27
↓ 3 callers
Method
StartConsumer
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 callers
Function
FormatDuration
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 callers
Function
GetCache
GetCache gets cached data from Redis.
internal/cache/cache.go:27
↓ 2 callers
Method
Publish
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 callers
Function
PublishInChannel
PublishInChannel publishes a message to a Rabbit exchange using a provided channel. For use in go routines.
internal/rabbit/publish.go:17
↓ 2 callers
Function
addAlert
(msg: string)
web/react/src/home.tsx:28
↓ 2 callers
Function
handleAPICache
handleAPICache handles API calls for cached messages.
cmd/server/api.go:13
↓ 2 callers
Function
insertToDB
insertToDB inserts a Rabbit message into a Postgres database.
cmd/database/database.go:56
↓ 2 callers
Function
updateRedis
updateRedis updates Redis with a new Rabbit message.
cmd/cache/cache.go:49
↓ 1 callers
Function
GetCacheJSON
GetCacheJSON marshals cached data into JSON, calls GetCache to get the Cache struct.
internal/cache/cache.go:65
↓ 1 callers
Method
StartConsumerTemp
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 callers
Function
handleMessages
handleMessages handles the messages page.
cmd/server/server.go:74
↓ 1 callers
Function
handleNotFound
handleNotFound handles 404
cmd/server/server.go:183
↓ 1 callers
Function
handlePublishRabbit
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 callers
Function
handleWebsocket
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 callers
Function
handleWebsocketConn
handleWebsocketConn passes a Rabbit connection to the Websocket handler.
cmd/server/server.go:101
↓ 1 callers
Function
handleWriteWebsocket
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 callers
Function
publishInput
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 callers
Function
sendMessage
(message: string)
web/react/src/home.tsx:11
↓ 1 callers
Function
testArguments
testArguments produces arguments for the function being tested
cmd/cache/cache_test.go:59
↓ 1 callers
Function
testArguments
testArguments produces arguments for the function being tested
cmd/database/database_test.go:46
↓ 1 callers
Function
testUpdateRedis
testUpdateRedis inserts a marshalled message into mock redis
cmd/server/api_test.go:52
Function
Alert
({alert}: alertProps)
web/react/src/alert.tsx:8
Function
App
()
web/react/src/app.tsx:12
Function
Form
({sendMessage}: formProps)
web/react/src/form.tsx:7
Function
Home
()
web/react/src/home.tsx:6
Function
Messages
()
web/react/src/messages.tsx:10
Function
StartReader
StartReader reads messages from a Websocket connection and passes them to a supplied handler for processing.
internal/websocket/read.go:11
Function
TestAPICache
TestAPICache tests the cache API
cmd/server/api_test.go:23
Function
TestFormatDuration
TestFormatDuration tests duration formatting
internal/timeutil/timeutil_test.go:9
Function
TestInsertToDB
TestInsertToDB tests a message insertion into a database
cmd/database/database_test.go:15
Function
TestUpdateRedis
TestUpdateRedis tests a message insertion into cache
cmd/cache/cache_test.go:17
Function
handleHome
handleHome handles the home page.
cmd/server/server.go:64
Function
main
()
cmd/cache/cache.go:18
Function
main
()
cmd/database/database.go:19
Function
main
()
cmd/backend/backend.go:20
Function
main
()
cmd/server/server.go:33
Function
printMessages
printMessages prints messages to stdout.
cmd/backend/backend.go:42
Method
sendMessage
(s: string)
web/react/src/form.tsx:4
Function
submitMessage
(e: React.FormEvent<HTMLFormElement>)
web/react/src/form.tsx:10