How to run the profilesvc ? Instructions to run and test it.

59 views
Skip to first unread message

Tom Wallick

unread,
Apr 18, 2018, 10:12:15 PM4/18/18
to Go kit
I like the go-kit toolkit and its clean design. I have spent some days going over it and finally am getting a good grip of how to follow this style of coding to other microservices I will have to do. I have chosen the profilesvc as a guide for the others I will have to write.

I would appreciate a quick how-to in starting up the profilesvc. I don't see a README on how I would test it.

I did :

go install and the profilesvc exe is produced but I don't understand the client package/folder.

Is that the code that talks to the profilesvc server ?

What are the steps for me to run this profilesvc ? With POSTMAN ? Please explain what that client/ directory is (client.go).

Again the code I am referring to is :


This will allow me to justify its use in our project.

I kind of need the reply in the next day or so since i will have to come up with a reply to stakeholders.

Thank you.

Tom W.

Wade Arnold

unread,
May 1, 2018, 12:28:52 PM5/1/18
to Go kit

Run the example with the optional port address for the service:

$ go run ./cmd/profilesvc/main.go -http.addr :8080


Create a Profile:

$ curl -d '{"id":"1234","Name":"Go Kit"}' -H "Content-Type: application/json" -X POST http://localhost:8080/profiles/
{}


Get the profile you just created

$ curl localhost:8080/profiles/1234
{"profile":{"id":"1234","name":"Go Kit"}}


Work through the services code structs and transport endpoints to work with the additional services. 


Hope that helps Tom. 


Thanks! 

Wade

Reply all
Reply to author
Forward
0 new messages