Browse Source

Initial commit for Goji, plaintext test passing

Zane Kansil 10 years ago
parent
commit
31202b6081

+ 3 - 0
frameworks/Go/goji/README.md

@@ -0,0 +1,3 @@
+# Goji (Golang) Benchmarking Test
+
+This is the go portion of a [benchmarking test suite](../) comparing a variety of web development platforms.

+ 4 - 0
frameworks/Go/goji/bash_profile.sh

@@ -0,0 +1,4 @@
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+
+export GOPATH=${TROOT}

+ 28 - 0
frameworks/Go/goji/benchmark_config

@@ -0,0 +1,28 @@
+{
+  "framework": "goji",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/queries?queries=",
+      "fortune_url": "/fortune",
+      "update_url": "/update?queries=",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "MySQL",
+      "framework": "Goji",
+      "language": "Go",
+      "orm": "Raw",
+      "platform": "Go",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Goji",
+      "notes": "",
+      "versus": "go"
+    }
+  }]
+}

+ 3 - 0
frameworks/Go/goji/install.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+fw_depends go

+ 10 - 0
frameworks/Go/goji/setup.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/hello/hello.go
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+
+go run src/goji/server.go &

+ 20 - 0
frameworks/Go/goji/src/goji/server.go

@@ -0,0 +1,20 @@
+package main
+
+import (
+	"fmt"
+	"net/http"
+	"flag"
+
+	"github.com/zenazn/goji"
+	"github.com/zenazn/goji/web"
+)
+
+func plaintext(c web.C, w http.ResponseWriter, r *http.Request) {
+	fmt.Fprintf(w, "Hello, World!")
+}
+
+func main() {
+	flag.Set("bind", ":8080")
+	goji.Get("/plaintext", plaintext)
+	goji.Serve()
+}