Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: embed code into markdown and keep everything in sync #191

Merged
merged 3 commits into from
Feb 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ pipeline:
environment:
- GOPATH=/go
commands:
- make deps
- make vet
- make lint
- make build
- make embedmd
- coverage all
# send coverage report
- make coverage
Expand Down
2 changes: 1 addition & 1 deletion .drone.yml.sig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIHBhdGg6IC9nby9zcmMvZ2l0aHViLmNvbS9hcHBsZWJveS9nb3J1c2gKCnBpcGVsaW5lOgogIGNsb25lOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0CiAgICB0YWdzOiB0cnVlCgogIGJ1aWxkOgogICAgaW1hZ2U6IGFwcGxlYm95L2dvbGFuZy10ZXN0aW5nOiR7R09fVkVSU0lPTn0KICAgIGVudmlyb25tZW50OgogICAgICAtIEdPUEFUSD0vZ28KICAgIGNvbW1hbmRzOgogICAgICAtIG1ha2UgdmV0CiAgICAgIC0gbWFrZSBsaW50CiAgICAgIC0gbWFrZSBidWlsZAogICAgICAtIGNvdmVyYWdlIGFsbAogICAgICAjIHNlbmQgY292ZXJhZ2UgcmVwb3J0CiAgICAgIC0gbWFrZSBjb3ZlcmFnZQogICAgICAjIGJ1aWxkIGJpbmFyeSBmb3IgZG9ja2VyIGltYWdlCiAgICAgIC0gbWFrZSBkb2NrZXJfYnVpbGQKCiAgcmVsZWFzZToKICAgIGltYWdlOiBhcHBsZWJveS9nb2xh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ICAgbWF0cml4OgogICAgICAgIEdPX1ZFUlNJT046IDEuOC4wCgogIGRvY2tlcjoKICAgIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogICAgcmVwbzogYXBwbGVib3kvZ29ydXNoCiAgICB0YWdzOiBbICcke0RST05FX1RBR30nIF0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHRhZyBdCiAgICAgIGJyYW5jaDogWyByZWZzL3RhZ3MvKiBdCgogIGRvY2tlcjoKICAgIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogICAgcmVwbzogYXBwbGVib3kvZ29ydXNoCiAgICB0YWdzOiBbICdsYXRlc3QnIF0KICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHB1c2ggXQogICAgICBicmFuY2g6IFsgbWFzdGVyIF0KCiAgZmFjZWJvb2s6CiAgICBpbWFnZTogYXBwbGVib3kvZHJvbmUtZmFjZWJvb2sKICAgIHB1bGw6IHRydWUKICAgIHRvOiAxMjM0OTczMzg2NTI0NjEwCiAgICB3aGVuOgogICAgICBzdGF0dXM6IFsgc3VjY2VzcywgZmFpbHVyZSBdCiAgICAgIG1hdHJpeDoKICAgICAgICBHT19WRVJTSU9OOiAxLjguMAoKICBnaXRodWI6CiAgICBpbWFnZTogcGx1Z2lucy9naXRodWItcmVsZWFzZQogICAgZmlsZXM6CiAgICAgIC0gZGlzdC9yZWxlYXNlLyoKICAgIHdoZW46CiAgICAgIGV2ZW50OiBbIHRhZyBdCiAgICAgIGJyYW5jaDogWyByZWZzL3RhZ3MvKiBdCiAgICAgIG1hdHJpeDoKICAgICAgICBHT19WRVJTSU9OOiAxLjguMAoKc2VydmljZXM6CiAgcmVkaXM6CiAgICBpbWFnZTogcmVkaXM6YWxwaW5lCgptYXRyaXg6CiAgR09fVkVSU0lPTjoKICAgIC0gMS44LjAKICAgIC0gMS43LjUKICAgIC0gMS42LjQK.7ieZ2R6o0gwph45wl0Dbu9RRm_H36d0b9_fw38tqLOU
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go:
- 1.6.x
- 1.7.x
- 1.8.x
- tip
- master

env:
global:
Expand All @@ -18,6 +18,8 @@ env:
- secure: jbMSWnlmLHAXtI1A22aDyUvVWbXq1aRjW1EXcMyzAamBMl4c+47lrkoCnHuQaCY4kOWJ4ux7zPrnXL2j0HTqF7ZXzbw0TixG9dm8MK4TEImCcTcR8VQYbCCdiCM+MKy3XTewN2e1lCAzYu4oKO6xt424yvlowuWiunWZ9YVFfKRpXvfWDd9Rt20PYP7cPyqifRdk4aKI8H+hXWGdeRkRoQvZMa1TdFwRmyg0jfrw94xz/GKNLsSXIu3XBY4LSzzBNUmfcIPpK2TuqAyLxb4d/L+OXG5KQZpydLJgE+GGxtqyAcNkK1ps4Qf3ua6DbGVdQ6Zg0db3g5OLu5LsyvO2jQQIPUQbVDRwwHmT2pDRhz8e8VUMGmokgMX2gAXjxJJ3CFPZAaR9VAzhtlQxbrFi5zSU7VAv92XLNNAdQhA+FFQryC/myI0V82reVWUlXMZsKqBdn5Zq7EA2AsW06NxW8REewUb3o9gauz+B8jAAXtIXZEXWVGqVLXLQceokAWQgrhOBKuE8H3Fuq1tT5VqaDcbvPT0LEU4FdSVBd1+JU0W9nJ4SF2nivJ4tCeZRgtKhaoG2n5gwM9L3fSdZTSrcZL4Gn9XfDZL5hV5GezrdGGGMfhtfIllJPFv3TjYNUlo3F2L3QB9D6SQR3VeLXHAB+IHw6VWwkOSqfEQVf4d8kHo=

script:
- make deps
- make embedmd
- make vet
- make lint
- make test
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ fmt:
vet:
go vet $(PACKAGES)

deps:
go get github.com/campoy/embedmd

embedmd:
embedmd -d *.md

errcheck:
@which errcheck > /dev/null; if [ $$? -ne 0 ]; then \
go get -u github.com/kisielk/errcheck; \
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,20 @@ A push notification micro server using [Gin](https://github.com/gin-gonic/gin) f

See the [YAML config example](config/config.yml):

[embedmd]:# (config/config.yml yaml)
```yaml
core:
port: "8088"
# default worker number is runtime.NumCPU()
worker_num: 0
# default queue number is 8192
queue_num: 0
worker_num: 0 # default worker number is runtime.NumCPU()
queue_num: 0 # default queue number is 8192
max_notification: 100
mode: "release"
ssl: false
cert_path: "cert.pem"
key_path: "key.pem"
http_proxy: "" # only working for GCM server
pid:
enabled: true
enabled: false
path: "gorush.pid"
override: true

Expand Down
20 changes: 9 additions & 11 deletions config/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
core:
port: "8088"
# default worker number is runtime.NumCPU()
worker_num: 0
# default queue number is 8192
queue_num: 0
worker_num: 0 # default worker number is runtime.NumCPU()
queue_num: 0 # default queue number is 8192
max_notification: 100
mode: "release"
ssl: false
cert_path: "cert.pem"
key_path: "key.pem"
http_proxy: ""
http_proxy: "" # only working for GCM server
pid:
enabled: false
path: "gorush.pid"
Expand All @@ -26,25 +24,25 @@ api:
android:
enabled: true
apikey: "YOUR_API_KEY"
max_retry: 0
max_retry: 0 # resend fail notification, default value zero is disabled

ios:
enabled: false
key_path: "key.pem"
password: ""
password: "" # certificate password, default as empty string.
production: false
max_retry: 0
max_retry: 0 # resend fail notification, default value zero is disabled

log:
format: "string" # string or json
access_log: "stdout"
access_log: "stdout" # stdout: output to console, or define log path like "log/access_log"
access_level: "debug"
error_log: "stderr"
error_log: "stderr" # stderr: output to console, or define log path like "log/error_log"
error_level: "error"
hide_token: true

stat:
engine: "memory"
engine: "memory" # support memory, redis, boltdb, buntdb or leveldb
redis:
addr: "localhost:6379"
password: ""
Expand Down