go run cmd/main.go
curl -X POST -F "file=@<path to dcm file>" localhost:8080/dicom
The response will show the ID
of the added file, with http status 201
To get one or more header attributes, specify the tags as query params
in the form group:element
. Multiple tags can be passed in.
curl -i -v "localhost:8080/dicom/8d25efb3-3331-49ed-ab23-b3f44edb6f01?tag=0010:1010&tag=0010:1020"
The response will show the specified tags and values.
To get the images encoded as png, use the GET api with the Accept-type
set to image/png
.
curl "localhost:8080/dicom/a538ed64-3ab3-47a5-b71d-238a349291a3" -H "Accept-type:image/png" -o xray.png
POST /dicom content-type:multipart/form-data => 201 url with resource id
GET /dicom/{id}?tag=0010:1010&tag=0010:1020
GET /dicom/{id} -H accept-type=image/png
The command runner to start the server
go run cmd/main.go
The service that provides the functionality
Wraps the dicom 3rd party library
Simple in memory data store
The http handlers that call out to the service
contains: new(repository) AddHandler(file)) GetByIdHandler(id)