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}} +