Browse Source

fix Sirupsen import

also change to use forked version of env and fs
tags/v0.10.0
John Robinson 4 years ago
parent
commit
dd85ae520c
No account linked to committer's email address
11 changed files with 25 additions and 25 deletions
  1. +2
    -2
      cmd/rex/new.go
  2. +5
    -5
      cmd/rex/run.go
  3. +3
    -3
      example/main.go
  4. +1
    -1
      middleware/cache_test.go
  5. +1
    -1
      middleware/compress_test.go
  6. +1
    -1
      middleware/header_test.go
  7. +1
    -1
      middleware/logger.go
  8. +1
    -1
      middleware/static_test.go
  9. +2
    -2
      rex.go
  10. +4
    -4
      server.go
  11. +4
    -4
      server_test.go

+ 2
- 2
cmd/rex/new.go View File

"regexp" "regexp"
"runtime" "runtime"


log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
log "github.com/sirupsen/logrus"


"github.com/goanywhere/cmd" "github.com/goanywhere/cmd"
"github.com/goanywhere/crypto" "github.com/goanywhere/crypto"
) )


const endpoint = "https://github.com/goanywhere/rex"
const endpoint = "https://git.thevis.us/skepto/rex"


var secrets = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*(-_+)") var secrets = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*(-_+)")



+ 5
- 5
cmd/rex/run.go View File

"runtime" "runtime"
"syscall" "syscall"


log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
log "github.com/sirupsen/logrus"


"github.com/goanywhere/rex/internal"
"github.com/goanywhere/rex/livereload"
"git.thevis.us/skepto/rex/internal"
"git.thevis.us/skepto/rex/livereload"


"git.thevis.us/skepto/env"
"git.thevis.us/skepto/fs"
"github.com/goanywhere/cmd" "github.com/goanywhere/cmd"
"github.com/goanywhere/env"
"github.com/goanywhere/fs"
) )


var ( var (

+ 3
- 3
example/main.go View File

"net/http" "net/http"
"path/filepath" "path/filepath"


"github.com/goanywhere/env"
"github.com/goanywhere/rex"
"github.com/goanywhere/rex/livereload"
"git.thevis.us/skepto/env"
"git.thevis.us/skepto/rex"
"git.thevis.us/skepto/rex/livereload"
) )


type User struct { type User struct {

+ 1
- 1
middleware/cache_test.go View File

"net/http/httptest" "net/http/httptest"
"testing" "testing"


"github.com/goanywhere/rex"
"git.thevis.us/skepto/rex"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )



+ 1
- 1
middleware/compress_test.go View File

"net/http/httptest" "net/http/httptest"
"testing" "testing"


"github.com/goanywhere/rex"
"git.thevis.us/skepto/rex"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )



+ 1
- 1
middleware/header_test.go View File

"net/http/httptest" "net/http/httptest"
"testing" "testing"


"github.com/goanywhere/rex"
"git.thevis.us/skepto/rex"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )



+ 1
- 1
middleware/logger.go View File

"net/http" "net/http"
"time" "time"


"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
) )


// Logger renders the simple HTTP accesses logs for the upcoming http.Handler. // Logger renders the simple HTTP accesses logs for the upcoming http.Handler.

+ 1
- 1
middleware/static_test.go View File

"path" "path"
"testing" "testing"


"github.com/goanywhere/rex"
"git.thevis.us/skepto/rex"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )



+ 2
- 2
rex.go View File

"net/http" "net/http"
"path" "path"


"github.com/goanywhere/env"
"github.com/goanywhere/fs"
"git.thevis.us/skepto/env"
"git.thevis.us/skepto/fs"
) )


// Shortcut for string based map. // Shortcut for string based map.

+ 4
- 4
server.go View File

"sync" "sync"
"time" "time"


log "github.com/Sirupsen/logrus"
"github.com/goanywhere/env"
"git.thevis.us/skepto/env"
"github.com/gorilla/mux" "github.com/gorilla/mux"
log "github.com/sirupsen/logrus"
) )


var ( var (
// Host creates a new application group under the given (sub)domain. // Host creates a new application group under the given (sub)domain.
func (self *server) Host(domain string) *server { func (self *server) Host(domain string) *server {
var middleware = new(middleware) var middleware = new(middleware)
self.mux.Host(domain).Handler(middleware)
var mux = self.mux.Host(domain).Subrouter()
self.mux.Host(domain).Handler(middleware)
var mux = self.mux.Host(domain).Subrouter()


server := &server{middleware: middleware, mux: mux} server := &server{middleware: middleware, mux: mux}
self.subservers = append(self.subservers, server) self.subservers = append(self.subservers, server)

+ 4
- 4
server_test.go View File

"path" "path"
"testing" "testing"


"github.com/goanywhere/env"
mw "github.com/goanywhere/rex/middleware"
"git.thevis.us/skepto/env"
mw "git.thevis.us/skepto/rex/middleware"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )


w.Header().Set("X-Powered-By", "base") w.Header().Set("X-Powered-By", "base")
}) })


user := app.Host("localhost")
user := app.Host("localhost")
user.Get("/", func(w http.ResponseWriter, r *http.Request) { user.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Powered-By", "rex") w.Header().Set("X-Powered-By", "rex")
}) })


Convey("rex.Host", t, func() { Convey("rex.Host", t, func() {
request, _ := http.NewRequest("GET", "http://localhost/", nil)
request, _ := http.NewRequest("GET", "http://localhost/", nil)
response := httptest.NewRecorder() response := httptest.NewRecorder()


app.ServeHTTP(response, request) app.ServeHTTP(response, request)

Loading…
Cancel
Save