https://github.com/raravena80/stringsvc
Sample string service using go-kit
https://github.com/raravena80/stringsvc
go microservice papupapa
Last synced: 3 months ago
JSON representation
Sample string service using go-kit
- Host: GitHub
- URL: https://github.com/raravena80/stringsvc
- Owner: raravena80
- Created: 2017-12-25T21:06:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-28T04:59:22.000Z (about 8 years ago)
- Last Synced: 2024-12-29T20:44:15.254Z (over 1 year ago)
- Topics: go, microservice, papupapa
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stringsvc
Sample count and uppercase service using go-kit. Includes instrumentation and metrics.
From: [go-kit examples](https://github.com/go-kit/kit/tree/master/examples)
## Run
Basic usage:
```
go run *.go
```
Specify port:
```
go run *.go -listen:8020
```
Specify proxy:
```
go run *go -listen:8021 -proxy=localhost:8020
```
## Use
```
$ curl -XPOST http://localhost:8080/count -d '{"s": "my happy string"}'
{"v":15}
curl -XPOST http://localhost:8080/uppercase -d '{"s": "my happy string"}'
{"v":"MY HAPPY STRING"}
curl -XPOST http://localhost:8080/downcase -d '{"s": "MY HAPPY STRING"}'
{"v":"my happy string"}
$ curl -XPOST http://localhost:8080/palindrome -d '{"s": "MY HAPPY STRING"}'
{"v":false}
$ curl -XPOST http://localhost:8080/palindrome -d '{"s": "ana"}'
{"v":true}
```