Quick start with GO lang to implement rest api and various operations.
Rest api exposes GET AND POST methods to user.
Item structure is as below -
type Item struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
}- Docker
- Create a project direcotry (optional)
$ mkdir -p Projects
$ cd Projects- Clone the repo
~/Projects/$ gh repo clone jai2036/gorestapi- Go to app directory (~/Projects/gorestapi/) and build the dockerfile.
~gorestapi/$ docker build -t jai/myapp .- Run the image.
# list images and copy the id
~gorestapi/$ docker images
# Run your image
~gorestapi/$ docker run -d -p 8080:8080 <image id>
