It's called that because it check ids.
- Bouncer is a database API server that receives an array of id's and checks for their presence in a database, leveraging the speed and efficiency of a MySQL/Postgres server.
- Written with Go, Echo (v2.2.0) and Postgres.
- Figure out why test is panicking
- Seems to be related to the call to
db.Query()
when the database connection object is embedded in the struct.
- Seems to be related to the call to
- The test seems like it was panicking because
database/sql
needed a db connection. - Had to switch over to the testing tools provided by the Echo team.
- Have
web.go
instantiate aPGConn
struct that has a live PG connection to query with as an attribute
How do we get the Post handler function to gain access to the db connection without having to make multiple connections to PG?
- Test if the request is actually being made in the test by making a dead simple Post handler
rec.Body
response from the http recorder is returning some weird nonsense string and not the json object that we expect.eyJtYXRjaGVkQ291bnQiOjEsIm1hdGNoZWRJZHMiOlsxLDJdfQ==
- Check this out
- It seems like the issue was that I was marshaling JSON and
ctx.json
was marshaling it again.
- Why is the
main()
function immediately returning?- Something seems broken about how I'm providing the database url, it seems like it was
working when it was directly placed into the
sql.Open
- Something seems broken about how I'm providing the database url, it seems like it was
working when it was directly placed into the
- Deploy this to Heroku