From 024c5a4e4e535a0da798c1b695f350455d85a241 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Thu, 16 Mar 2017 17:47:54 +0100 Subject: [PATCH] Add sitemap (non-code) example --- Makefile | 1 + examples/sitemap/Makefile | 3 +++ examples/sitemap/sitemap.proto | 12 ++++++++++++ examples/sitemap/sitemap.xml | 21 +++++++++++++++++++++ examples/sitemap/sitemap.xml.tmpl | 9 +++++++++ 5 files changed, 46 insertions(+) create mode 100644 examples/sitemap/Makefile create mode 100644 examples/sitemap/sitemap.proto create mode 100644 examples/sitemap/sitemap.xml create mode 100644 examples/sitemap/sitemap.xml.tmpl diff --git a/Makefile b/Makefile index 0bd74bb..0c4a4fe 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ test: build cd examples/flow && make cd examples/concat && make cd examples/flow && make + cd examples/sitemap && make cd examples/go-kit && make .PHONY: docker.build diff --git a/examples/sitemap/Makefile b/examples/sitemap/Makefile new file mode 100644 index 0000000..d9d5264 --- /dev/null +++ b/examples/sitemap/Makefile @@ -0,0 +1,3 @@ +.PHONY: build +build: + protoc -I. --gotemplate_out=template_dir=.:. sitemap.proto diff --git a/examples/sitemap/sitemap.proto b/examples/sitemap/sitemap.proto new file mode 100644 index 0000000..af5e9e7 --- /dev/null +++ b/examples/sitemap/sitemap.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package sitemap; + +service DummyService { + rpc Posts(Request) returns (Response) {} + rpc Authors(Request) returns (Response) {} + rpc Comments(Request) returns (Response) {} +} + +message Request {} +message Response {} \ No newline at end of file diff --git a/examples/sitemap/sitemap.xml b/examples/sitemap/sitemap.xml new file mode 100644 index 0000000..315b7ce --- /dev/null +++ b/examples/sitemap/sitemap.xml @@ -0,0 +1,21 @@ + + + + /posts + 0.5 + monthly + 2017-03-16 + + + /authors + 0.5 + monthly + 2017-03-16 + + + /comments + 0.5 + monthly + 2017-03-16 + + diff --git a/examples/sitemap/sitemap.xml.tmpl b/examples/sitemap/sitemap.xml.tmpl new file mode 100644 index 0000000..8bb4511 --- /dev/null +++ b/examples/sitemap/sitemap.xml.tmpl @@ -0,0 +1,9 @@ + +{{range .Service.Method}} + + /{{.Name | lower}} + 0.5 + monthly + {{now | date "2006-01-02"}} + {{end}} +