eug48 / fhir

FHIR Server using MongoDB and Go - now with proper transactions support! Aims to start quickly, have modest resource requirements and good performance.
Apache License 2.0
69 stars 16 forks source link

Switch to go modules #2

Closed loafoe closed 5 years ago

loafoe commented 5 years ago

This PR switches the project from from dep to go modules for dependency management. It also upgrades the Dockerfile images to use Go 1.12.1

eug48 commented 5 years ago

Thanks very much. I just need to learn a bit more about go modules before I merge this.

By the way, what tools did you use to do the migration? Have any packages been upgraded? For example, I've noticed that cloud.google.com/go is in go.sum but wasn't in the dep lockfile.

loafoe commented 5 years ago

Hi @eug48 , many thanks for maintaining this project!

I just used the standard go mod tool. Basically:

$ go mod init
go: creating new go.mod: module github.com/eug48/fhir
go: copying requirements from Gopkg.lock

This step examines the existing Gopkg.* files and writes out newgo.mod` file. I added the line:

replace github.com/eug48/fhir v0.0.0 => /

The only version tweak I did was to force github.com/mongodb/mongo-go-driver to version v0.0.12. For some reason the conversion pinned it to v1.0.0which is incompatible. Initially I tried to port the code to use thev1.0.0 of the mongo driver but this was a bridge too far especially since my mongo skills are nil :)

Ultimately I want to contribute to adding PostgreSQL support.

The cloud.google.com/go dependency is coming from below:

$ go mod graph|grep cloud.google.com/go
golang.org/x/oauth2@v0.0.0-20190319182350-c85d3e98c914 cloud.google.com/go@v0.34.0
eug48 commented 5 years ago

Ok looks good & the tests pass. I'll merge it now - thanks!

PostgreSQL support would be brilliant. You might have noticed I've jotted down some ideas in this repository - but please don't feel constrained by them. One thing I've thought about since then is that it would be great to develop PostgreSQL support with a view to also enabling SQLite support at some point. SQLite would be very useful for running this server on end-user devices, and for testing/CI use-cases.

eug48 commented 5 years ago

I've had to revert this since when under concurrent load HTTP responses were being intermittently concatenated with those from other requests... Not sure why yet. It may have something to do with my new FileLoggerMiddleware & some dependency upgrades as a result of this PR.

eug48 commented 5 years ago

I think I've got it done in 16306ba without problems under load The new version of go mod init looks to have preserved the correct version of gin from Gopkg.lock