From 5e8b9a0bf6e79ea34de830d0f0a092681301bd6b Mon Sep 17 00:00:00 2001 From: Colin Henry Date: Sat, 9 Nov 2019 08:13:14 -0800 Subject: [PATCH] renamed package --- auth/service.go | 4 ++-- cmd/auth-demo/main.go | 6 +++--- cmd/sub-demo/main.go | 4 ++-- payments/service.go | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/auth/service.go b/auth/service.go index ca07180..6bd2c70 100644 --- a/auth/service.go +++ b/auth/service.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/codegangsta/negroni" - jch_http "github.com/jchenry/jchenry/http" + _http "github.com/jchenry/jchenry/http" "gopkg.in/auth0.v1/management" ) @@ -16,7 +16,7 @@ type ServiceInstance struct { c Config } -func (si ServiceInstance) Register(uriBase string, s *jch_http.Server) { +func (si ServiceInstance) Register(uriBase string, s *_http.Server) { s.Get(uriBase+"/login", "login endpoint", http.HandlerFunc(NewLoginHandler(si.c))) s.Get(uriBase+"/logout", "logout endpoint", http.HandlerFunc(LogoutHandler)) diff --git a/cmd/auth-demo/main.go b/cmd/auth-demo/main.go index f04bbe3..b383767 100644 --- a/cmd/auth-demo/main.go +++ b/cmd/auth-demo/main.go @@ -6,7 +6,7 @@ import ( "github.com/codegangsta/negroni" "github.com/jchenry/jchenry/auth" - jch_http "github.com/jchenry/jchenry/http" + _http "github.com/jchenry/jchenry/http" ) func main() { @@ -16,7 +16,7 @@ func main() { func StartServer() { auth.PrintConfig() - s := jch_http.NewServer(negroni.New(), jch_http.NewJulienschmidtHTTPRouter()). + s := _http.NewServer(negroni.New(), _http.NewJulienschmidtHTTPRouter()). Static("/public/*filepath", http.Dir("public/")). Service("", auth.Service(auth.FromEnv())). Get("/", "", http.HandlerFunc(HomeHandler)) @@ -30,5 +30,5 @@ func StartServer() { } func HomeHandler(w http.ResponseWriter, r *http.Request) { - jch_http.RenderTemplate(w, "home", nil) + _http.RenderTemplate(w, "home", nil) } diff --git a/cmd/sub-demo/main.go b/cmd/sub-demo/main.go index 7e21472..174963e 100644 --- a/cmd/sub-demo/main.go +++ b/cmd/sub-demo/main.go @@ -6,7 +6,7 @@ import ( "github.com/codegangsta/negroni" "github.com/jchenry/jchenry/auth" - jch_http "github.com/jchenry/jchenry/http" + _http "github.com/jchenry/jchenry/http" "github.com/jchenry/jchenry/payments" ) @@ -20,7 +20,7 @@ func StartServer() { payments.PrintConfig() auth_service := auth.Service(auth.FromEnv()) - s := jch_http.NewServer(negroni.New(), jch_http.NewJulienschmidtHTTPRouter()). + s := _http.NewServer(negroni.New(), _http.NewJulienschmidtHTTPRouter()). Static("/public/*filepath", http.Dir("public/")). Service("", auth_service). Service("", payments.Service(payments.FromEnv(), &auth_service)). diff --git a/payments/service.go b/payments/service.go index a1ac145..3e964bd 100644 --- a/payments/service.go +++ b/payments/service.go @@ -6,7 +6,7 @@ import ( "github.com/codegangsta/negroni" "github.com/jchenry/jchenry/auth" - jch_http "github.com/jchenry/jchenry/http" + _http "github.com/jchenry/jchenry/http" "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/client" "github.com/stripe/stripe-go/customer" @@ -32,7 +32,7 @@ type ServiceInstance struct { auth *auth.ServiceInstance } -func (si ServiceInstance) Register(uriBase string, s *jch_http.Server) { +func (si ServiceInstance) Register(uriBase string, s *_http.Server) { s.Get(uriBase+"/subscription", "subscription info endpoint", negroni.New( negroni.HandlerFunc(auth.IsAuthenticated), negroni.Wrap(http.HandlerFunc(si.subscriptionHandler)), @@ -56,7 +56,7 @@ func (si ServiceInstance) subscriptionHandler(w http.ResponseWriter, r *http.Req for it.Next() { plans = append(plans, *it.Plan()) } - jch_http.RenderTemplate(w, "subscription", offering{Product: *prod, Plans: plans}) + _http.RenderTemplate(w, "subscription", offering{Product: *prod, Plans: plans}) } type offering struct {