renamed package

This commit is contained in:
Colin Henry 2019-11-09 08:13:14 -08:00
parent 4697006d10
commit 5e8b9a0bf6
4 changed files with 10 additions and 10 deletions

View File

@ -4,7 +4,7 @@ import (
"net/http" "net/http"
"github.com/codegangsta/negroni" "github.com/codegangsta/negroni"
jch_http "github.com/jchenry/jchenry/http" _http "github.com/jchenry/jchenry/http"
"gopkg.in/auth0.v1/management" "gopkg.in/auth0.v1/management"
) )
@ -16,7 +16,7 @@ type ServiceInstance struct {
c Config 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+"/login", "login endpoint", http.HandlerFunc(NewLoginHandler(si.c)))
s.Get(uriBase+"/logout", "logout endpoint", http.HandlerFunc(LogoutHandler)) s.Get(uriBase+"/logout", "logout endpoint", http.HandlerFunc(LogoutHandler))

View File

@ -6,7 +6,7 @@ import (
"github.com/codegangsta/negroni" "github.com/codegangsta/negroni"
"github.com/jchenry/jchenry/auth" "github.com/jchenry/jchenry/auth"
jch_http "github.com/jchenry/jchenry/http" _http "github.com/jchenry/jchenry/http"
) )
func main() { func main() {
@ -16,7 +16,7 @@ func main() {
func StartServer() { func StartServer() {
auth.PrintConfig() auth.PrintConfig()
s := jch_http.NewServer(negroni.New(), jch_http.NewJulienschmidtHTTPRouter()). s := _http.NewServer(negroni.New(), _http.NewJulienschmidtHTTPRouter()).
Static("/public/*filepath", http.Dir("public/")). Static("/public/*filepath", http.Dir("public/")).
Service("", auth.Service(auth.FromEnv())). Service("", auth.Service(auth.FromEnv())).
Get("/", "", http.HandlerFunc(HomeHandler)) Get("/", "", http.HandlerFunc(HomeHandler))
@ -30,5 +30,5 @@ func StartServer() {
} }
func HomeHandler(w http.ResponseWriter, r *http.Request) { func HomeHandler(w http.ResponseWriter, r *http.Request) {
jch_http.RenderTemplate(w, "home", nil) _http.RenderTemplate(w, "home", nil)
} }

View File

@ -6,7 +6,7 @@ import (
"github.com/codegangsta/negroni" "github.com/codegangsta/negroni"
"github.com/jchenry/jchenry/auth" "github.com/jchenry/jchenry/auth"
jch_http "github.com/jchenry/jchenry/http" _http "github.com/jchenry/jchenry/http"
"github.com/jchenry/jchenry/payments" "github.com/jchenry/jchenry/payments"
) )
@ -20,7 +20,7 @@ func StartServer() {
payments.PrintConfig() payments.PrintConfig()
auth_service := auth.Service(auth.FromEnv()) 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/")). Static("/public/*filepath", http.Dir("public/")).
Service("", auth_service). Service("", auth_service).
Service("", payments.Service(payments.FromEnv(), &auth_service)). Service("", payments.Service(payments.FromEnv(), &auth_service)).

View File

@ -6,7 +6,7 @@ import (
"github.com/codegangsta/negroni" "github.com/codegangsta/negroni"
"github.com/jchenry/jchenry/auth" "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"
"github.com/stripe/stripe-go/client" "github.com/stripe/stripe-go/client"
"github.com/stripe/stripe-go/customer" "github.com/stripe/stripe-go/customer"
@ -32,7 +32,7 @@ type ServiceInstance struct {
auth *auth.ServiceInstance 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( s.Get(uriBase+"/subscription", "subscription info endpoint", negroni.New(
negroni.HandlerFunc(auth.IsAuthenticated), negroni.HandlerFunc(auth.IsAuthenticated),
negroni.Wrap(http.HandlerFunc(si.subscriptionHandler)), negroni.Wrap(http.HandlerFunc(si.subscriptionHandler)),
@ -56,7 +56,7 @@ func (si ServiceInstance) subscriptionHandler(w http.ResponseWriter, r *http.Req
for it.Next() { for it.Next() {
plans = append(plans, *it.Plan()) 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 { type offering struct {