From 2e8f745c85253165988b7dd243f4e51e31531045 Mon Sep 17 00:00:00 2001 From: Gosuke Miyashita Date: Mon, 16 Apr 2018 17:02:02 +0900 Subject: [PATCH] Enable to install by go get --- Makefile | 4 ++-- README.md | 22 +++++++++++-------- .../main.go} | 2 -- cmd/nolmandy/{nolmandy.go => main.go} | 2 -- 4 files changed, 15 insertions(+), 15 deletions(-) rename cmd/{nolmandy/nolmandy_server.go => nolmandy-server/main.go} (97%) rename cmd/nolmandy/{nolmandy.go => main.go} (98%) diff --git a/Makefile b/Makefile index 735d2aa..3ce1c28 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,8 @@ fmt: setup goimports -w . build: - vgo build -o bin/$(NAME) cmd/nolmandy/nolmandy.go - vgo build -o bin/$(NAME)-server cmd/nolmandy/nolmandy_server.go + vgo build -o bin/$(NAME) cmd/nolmandy/main.go + vgo build -o bin/$(NAME)-server cmd/nolmandy-server/main.go clean: rm bin/$(NAME) diff --git a/README.md b/README.md index 5309abc..ccbed13 100644 --- a/README.md +++ b/README.md @@ -10,35 +10,39 @@ Also you can use nolmandy as a receipt processing library. ## Usage -### Compile nolmandy +### As a receipt validation command line tool -Run make command. +Install `nolmandy` command. ``` -make +go get github.com/aktsk/nolmandy/cmd/nolmandy ``` -### As a receipt validation command line tool - Run nolmandy command to validate a receipt by Apple Root certificate. ``` -cat receipt | bin/nolmandy +cat receipt | nolmandy ``` You can validate a certificate by your own certificate. ``` -cat receipt | bin/nolmandy -certFile cert.pem +cat receipt | nolmandy -certFile cert.pem ``` ### As a validation server +Install `nolmandy-server` command. + +``` +go get github.com/aktsk/nolmandy/cmd/nolmandy-server +``` + Run nolmandy server. ``` -bin/nolmandy-server -port 8000 +nolmandy-server -port 8000 ``` Post base64 encoded receipt data to nolmandy server. @@ -51,7 +55,7 @@ curl -s -H 'Content-Type:application/json' -d '{ "receipt-data": "MIIeWQYJK..." You can use your own certificate instead of Apple certificate. ``` -bin/nolmandy-server -certFile cert.pem +nolmandy-server -certFile cert.pem ``` ### As a validation library diff --git a/cmd/nolmandy/nolmandy_server.go b/cmd/nolmandy-server/main.go similarity index 97% rename from cmd/nolmandy/nolmandy_server.go rename to cmd/nolmandy-server/main.go index 6505c16..70cd6f1 100644 --- a/cmd/nolmandy/nolmandy_server.go +++ b/cmd/nolmandy-server/main.go @@ -1,5 +1,3 @@ -// +build ignore - package main import ( diff --git a/cmd/nolmandy/nolmandy.go b/cmd/nolmandy/main.go similarity index 98% rename from cmd/nolmandy/nolmandy.go rename to cmd/nolmandy/main.go index 2632860..2fa339e 100644 --- a/cmd/nolmandy/nolmandy.go +++ b/cmd/nolmandy/main.go @@ -1,5 +1,3 @@ -// +build ignore - package main import (