From 7a3757933db9a6b17065641e7e5b92f3b023a593 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sat, 29 Apr 2017 12:52:53 -0700 Subject: [PATCH] remove old api docs --- cmd/helloserver/gopreload.go | 9 -- cmd/helloserver/main.go | 38 ------- cmd/{httpagent => route-httpagent}/main.go | 0 doc/api.md | 115 --------------------- 4 files changed, 162 deletions(-) delete mode 100644 cmd/helloserver/gopreload.go delete mode 100644 cmd/helloserver/main.go rename cmd/{httpagent => route-httpagent}/main.go (100%) delete mode 100644 doc/api.md diff --git a/cmd/helloserver/gopreload.go b/cmd/helloserver/gopreload.go deleted file mode 100644 index 6829ae5..0000000 --- a/cmd/helloserver/gopreload.go +++ /dev/null @@ -1,9 +0,0 @@ -// gopreload.go -package main - -/* - This file is separate to make it very easy to both add into an application, but - also very easy to remove. -*/ - -import _ "github.com/Xe/gopreload" diff --git a/cmd/helloserver/main.go b/cmd/helloserver/main.go deleted file mode 100644 index feae031..0000000 --- a/cmd/helloserver/main.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "log" - "net/http" - "os" - "runtime" - - "github.com/kr/pretty" - "go.uber.org/atomic" -) - -var ( - port = flag.String("port", "9090", "HTTP port to listen on") - - hits *atomic.Int64 -) - -func main() { - flag.Parse() - hits = atomic.NewInt64(0) - http.ListenAndServe(":"+*port, http.HandlerFunc(handle)) -} - -func handle(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "Route is go!") - fmt.Fprintf(w, "%s\n", pretty.Sprintf("%s", r.Header)) - hn, _ := os.Hostname() - fmt.Fprintf(w, "Served by %s running %s\n", hn, runtime.GOOS) - fmt.Fprintf(w, "Hit count: %d", hits.Inc()) - - ip := r.Header.Get("X-Remote-Ip") - if ip != "" { - log.Printf("Hit from %s: %s", ip, r.RequestURI) - } -} diff --git a/cmd/httpagent/main.go b/cmd/route-httpagent/main.go similarity index 100% rename from cmd/httpagent/main.go rename to cmd/route-httpagent/main.go diff --git a/doc/api.md b/doc/api.md deleted file mode 100644 index e3d4a6b..0000000 --- a/doc/api.md +++ /dev/null @@ -1,115 +0,0 @@ -API calls -========= - -Host Management ---------------- - -```go -type HostKind int - -const ( - KindHTTP HostKind = iota - KindTCP - KindIRC - KindProxy -) - -type Host struct { - ID string `gorethink:"id,omitempty"` - Hostname string `gorethink:"hostname"` - OnionHostname string `gorethink:"onionhostname"` - Token string `gorethink:"token"` - OnionKey []byte `gorethink:"onionKey" json:"-"` // PEM-encoded - - Kind HostKind `gorethink:"hostKind"` - Port string `gorethink:"port"` - - AllowedUsers []string `gorethink:"allowedUsers"` -} -``` - -### AddHost - -This creates a new host in the routing mesh. - -```go -type AddHostRequest struct { - BaseAPICall - Hostname string - OnionKey *rsa.PrivateKey -} - -type AddHostResponse struct { - ID string - Token string // JWT - Hostname string - OnionHostname string -} -``` - -### GetHost - -### ModifyHost - -Token Management ----------------- - -```go -type Token struct { - ID string `gorethink:"id,omitempty" json:"jti"` - - ExpiresAt int64 `json:"exp,omitempty"` - IssuedAt int64 `json:"iat,omitempty"` - Issuer string `json:"iss,omitempty"` - Subject string `json:"sub,omitempty"` - - Revoked bool - RevocationID string - Scopes []string `json:"scopes"` -} -``` - -### CreateInitialToken - -### ValidateToken - -### CreateToken - -### ListTokens - -### RevokeToken - -Metrics -------- - -### Report - -Returns the following data for the last minute, the last 5 minutes and the last -10 minutes: - -- Number of requests processed -- Total request latency -- Longest request latency -- Shortest request latency - -Users ------ - -```go -type User struct { - ID string `gorethink:"id,omitempty"` - Email string `gorethink:"email"` - OauthMethod string `gorethink:"oauthMethod"` - IsAdmin bool `gorethink:"isADmin"` -} -``` - -### Login - -### Logout - -### Promote - -### Demote - -### AddNewLoginMethod