Please note that this repo is a sample project which is used for demonstrating code structure of micro services in Golang. Though it builds successfully, it can not be used in production.
- to build server: go build ./cmd/user_server
- to build client: go build ./cmd/user_server-cli
-
Register User curl -d '{"email":"[email protected]"}' -X POST https://app.local/api/v1/user/signup
-
Verify Confirmation Token curl -d '{"userId":585985938150129665,"confirmationToken":371323}' -X POST http://app.local/api/v1/user/verifyConfirmationToken
-
Update Username curl -d '{"name":"Santosh pd sah"}' -X POST https://app.local/api/v1/user/updateUsername -H "Authorization:your-auth-token"
-
Change Password curl -d '{"password":"Qwerty"}' -X POST http://app.local/api/v1/user/changePassword -H "Authorization:your-auth-token"
-
Login curl -d '{"email":"[email protected]","password":"Qwerty"}' -X POST https://app.local/api/v1/user/login
-
Refresh Access Token curl -X POST https://app.local/api/v1/user/refreshAccessToken -H "Authorization:your-auth-token"
-
Reset Password curl -d '{"email":"[email protected]"}' -X POST http://app.local/api/v1/user/resetPassword
-
Verify Confirmation Token curl -d '{"userId":475865469067493377,"passwordResetToken":865688}' -X POST http://app.local/api/v1/user/verifyPasswordResetToken
-
Logout: curl -X POST https://app.local/api/v1/user/logout -H "Authorization:your-auth-token"
Ref: https://github.com/fullstorydev/grpcurl
- Create new user
grpcurl -d '{"email":"[email protected]"}' -proto user_service.proto app.local:443 user_service.UserService/Signup
- Verify Confirmation Token
grpcurl -d '{"userId":596403424660324353,"confirmationToken":575537}' -proto user_service.proto app.local:443 user_service.UserService/VerifyConfirmationToken
- Update User Name
grpcurl -H "Authorization:your-auth-token" -d '{"name":"Santosh pd sah"}' -proto user_service.proto app.local:443 user_service.UserService/UpdateUsername
- Change/Set Password
grpcurl -H "Authorization:your-auth-token" -d '{"password":"Qwerty"}' -proto user_service.proto app.local:443 user_service.UserService/ChangePassword
- Login
grpcurl -d '{"email":"[email protected]","password":"Qwerty"}' -proto user_service.proto app.local:443 user_service.UserService/Login
- Change user name after login: Repeat of step with Auth Token
grpcurl -H "Authorization:your-auth-token" -d '{"name":"Santosh prasad sah"}' -proto user_service.proto app.local:443 user_service.UserService/UpdateUsername