change conf to argsset and flag for oauth

This commit is contained in:
bel
2019-10-22 04:52:04 +00:00
parent e20ba5361d
commit bc11dd7f82
10 changed files with 398 additions and 250 deletions

View File

@@ -3,6 +3,7 @@ package server
import (
"context"
"fmt"
"local/rproxy3/config"
"local/rproxy3/storage"
"net/http"
"net/http/httptest"
@@ -15,7 +16,10 @@ import (
func TestServerStart(t *testing.T) {
server := mockServer()
if err := server.Route("world", "http://hello.localhost"+server.addr); err != nil {
p := config.Proxy{
To: "http://hello.localhost" + server.addr,
}
if err := server.Route("world", p); err != nil {
t.Fatalf("cannot add route: %v", err)
}
@@ -48,7 +52,10 @@ func mockServer() *Server {
func TestServerRoute(t *testing.T) {
server := mockServer()
if err := server.Route("world", "http://hello.localhost"+server.addr); err != nil {
p := config.Proxy{
To: "http://hello.localhost" + server.addr,
}
if err := server.Route("world", p); err != nil {
t.Fatalf("cannot add route: %v", err)
}
w := httptest.NewRecorder()