From 592ea816871d256c27d89a1d656667373ecca656 Mon Sep 17 00:00:00 2001 From: kortschak Date: Wed, 23 Jul 2014 10:02:11 +0930 Subject: [PATCH] Use build constraints for appengine --- app.yaml | 8 ++++++++ appengine.go | 37 +++++++++++++++++++++++++++++++++++++ appengine/30k.nt | 1 - appengine/app.yaml | 8 -------- appengine/appengine.go | 35 ----------------------------------- appengine/cayley_appengine.cfg | 7 ------- appengine/docs | 1 - appengine/static | 1 - appengine/templates | 1 - cayley.go | 2 ++ cayley_appengine.cfg | 7 +++++++ 11 files changed, 54 insertions(+), 54 deletions(-) create mode 100644 app.yaml create mode 100644 appengine.go delete mode 120000 appengine/30k.nt delete mode 100644 appengine/app.yaml delete mode 100644 appengine/appengine.go delete mode 100644 appengine/cayley_appengine.cfg delete mode 120000 appengine/docs delete mode 120000 appengine/static delete mode 120000 appengine/templates create mode 100644 cayley_appengine.cfg diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..41b96a2 --- /dev/null +++ b/app.yaml @@ -0,0 +1,8 @@ +application: cayley-test +version: 1 +runtime: go +api_version: go1 + +handlers: +- url: /.* + script: _go_app diff --git a/appengine.go b/appengine.go new file mode 100644 index 0000000..515f7e9 --- /dev/null +++ b/appengine.go @@ -0,0 +1,37 @@ +// Copyright 2014 The Cayley Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build appengine + +package main + +import ( + "github.com/barakmich/glog" + + "github.com/google/cayley/config" + "github.com/google/cayley/db" + "github.com/google/cayley/graph" + "github.com/google/cayley/http" + + _ "github.com/google/cayley/graph/memstore" +) + +func init() { + glog.SetToStderr(true) + cfg := config.ParseConfigFromFile("cayley_appengine.cfg") + ts, _ := graph.NewTripleStore("memstore", "", nil) + glog.Errorln(cfg) + db.Load(ts, cfg, cfg.DatabasePath) + http.SetupRoutes(ts, cfg) +} diff --git a/appengine/30k.nt b/appengine/30k.nt deleted file mode 120000 index 0f1665c..0000000 --- a/appengine/30k.nt +++ /dev/null @@ -1 +0,0 @@ -../30kmovies.nt diff --git a/appengine/app.yaml b/appengine/app.yaml deleted file mode 100644 index 41b96a2..0000000 --- a/appengine/app.yaml +++ /dev/null @@ -1,8 +0,0 @@ -application: cayley-test -version: 1 -runtime: go -api_version: go1 - -handlers: -- url: /.* - script: _go_app diff --git a/appengine/appengine.go b/appengine/appengine.go deleted file mode 100644 index 4631765..0000000 --- a/appengine/appengine.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 The Cayley Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cayleyappengine - -import ( - "github.com/barakmich/glog" - - "github.com/google/cayley/config" - "github.com/google/cayley/db" - "github.com/google/cayley/graph" - "github.com/google/cayley/http" - - _ "github.com/google/cayley/graph/memstore" -) - -func init() { - glog.SetToStderr(true) - cfg := config.ParseConfigFromFile("cayley_appengine.cfg") - ts, _ := graph.NewTripleStore("memstore", "", nil) - glog.Errorln(cfg) - db.Load(ts, cfg, cfg.DatabasePath) - http.SetupRoutes(ts, cfg) -} diff --git a/appengine/cayley_appengine.cfg b/appengine/cayley_appengine.cfg deleted file mode 100644 index 3bf9166..0000000 --- a/appengine/cayley_appengine.cfg +++ /dev/null @@ -1,7 +0,0 @@ -{ -"database": "mem", -"db_path": "30k.nt", -"read_only": true, -"load_size": 10000, -"gremlin_timeout": 10 -} diff --git a/appengine/docs b/appengine/docs deleted file mode 120000 index a9594bf..0000000 --- a/appengine/docs +++ /dev/null @@ -1 +0,0 @@ -../docs \ No newline at end of file diff --git a/appengine/static b/appengine/static deleted file mode 120000 index 4dab164..0000000 --- a/appengine/static +++ /dev/null @@ -1 +0,0 @@ -../static \ No newline at end of file diff --git a/appengine/templates b/appengine/templates deleted file mode 120000 index 564a409..0000000 --- a/appengine/templates +++ /dev/null @@ -1 +0,0 @@ -../templates \ No newline at end of file diff --git a/cayley.go b/cayley.go index 24af7d3..87bf18b 100644 --- a/cayley.go +++ b/cayley.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build !appengine + package main import ( diff --git a/cayley_appengine.cfg b/cayley_appengine.cfg new file mode 100644 index 0000000..3bf9166 --- /dev/null +++ b/cayley_appengine.cfg @@ -0,0 +1,7 @@ +{ +"database": "mem", +"db_path": "30k.nt", +"read_only": true, +"load_size": 10000, +"gremlin_timeout": 10 +}