Github user rob05c commented on a diff in the pull request:
https://github.com/apache/incubator-trafficcontrol/pull/325#discussion_r107808306
--- Diff: traffic_ops/experimental/go-api/api.go ---
@@ -0,0 +1,112 @@
+package main
+
+/*
+ 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.
+*/
+
+/*
+This module it provides a server creating a RESTful API towards
Traffic-Ops DB.
+It was created in order to POC the concept of API Gateway (added on
another PR) between the different modules of Traffic-Ops, specifically old perl
Traffic-Ops, and new (go?) one.
+
+At first step, only "tenant" table is covered (CRUD).
+Other tables can be added, by adding modules (see tenant foe example), and
seeding their enpoints below.
+To Run this module, call: go run api.go --server --db-config-file
+e.g. go run api.go --server :8888 --db-config-file
../../app/conf/test/database.conf
+Note that the below go modules are required, so you'll might need to "go
get" them:)
+"github.com/gorilla/mux"
+"github.com/lib/pq"
+*/
+
+
+import (
+ "database/sql"
+ "encoding/json"
+ "flag"
+ "fmt"
+ "log"
+ "net/http"
+ "os"
+
+ "github.com/gorilla/mux"
+ _ "github.com/lib/pq"
--- End diff --
These must be vendored. If you haven't vendored Go before, this is done by
creating a `vendor` directory in `/go-api` with the full import path, i.e.
`mkdir -p vendor/github.com/lib`, cloning into it with `git clone
https://github.com/lib/pq`, and deleting the `.git` directory (DON'T forget
this, conflicting git directories will break everything).
In the future, common libraries like `pq` will be vendored in a parent
directory, but they aren't there yet.
Unvendored dependencies are both a security vulnerability and a point of
failure when the code changes underneath us.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---