Coder Social home page Coder Social logo

revel / examples Goto Github PK

View Code? Open in Web Editor NEW
340.0 24.0 185.0 840 KB

Example Revel Applications

Home Page: http://revel.github.io/examples/

License: MIT License

Go 44.43% CSS 5.00% JavaScript 9.05% HTML 41.53%
revel-applications go examples hacktoberfest

examples's Introduction

Example Revel Applications

Build Status

Each directory contains a standalone Revel application, eg

狂欢是好的,保存UTF8 。保持微笑,享受..抱怨..请让它好看

git clone https://github.com/revel/examples.git $GOPATH/src/github.com/revel/examples
revel run github.com/revel/examples/booking
  • Booking

    • A database-driven hotel-booking application, including user management
  • Chat

    • A chat room demonstrating active refresh, long-polling (comet), and websocket implementations.
  • Validation

  • Upload

    • Demonstrates single and multiple file uploads to a webserver via http.
  • Twitter OAuth

    • Display mentions and allows posting to a Twitter account using OAuth.
  • Facebook OAuth2

    • Display Facebook user information using OAuth2.
  • If you spot a mistake etc, then let us know
  • If you have a good sample application idea, then let us know
  • If you got an app, then please make a pull request

examples's People

Contributors

brendensoares avatar casualsuperman avatar davidzchen avatar gabrielmiller avatar jeevatkm avatar jgraham909 avatar karls avatar kyleconroy avatar longbai avatar meyermagic avatar notzippy avatar obsti8383 avatar pedromorgan avatar ptman avatar pushrax avatar pyprism avatar quinnwilton avatar robfig avatar shawncatz avatar sorter avatar teitei-tk avatar theothertomelliott avatar tmbrggmn avatar tqwewe avatar uplus avatar vascop avatar verdverm avatar ygabo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

README wrong guide

it seems that the command "go get github.com/revel/samples/..." should be used instead of command "go get github.com/revel/samples" to get all the samples.

Build error: unable to run examples

I tried to follow the readme instruction but i get this error:

ERROR 22:05:10 revel.go:98: Unable to determine import path from :


redabenh@macbook-pro-1 testrevel % revel run github.com/revel/examples/booking
ERROR 22:05:10   revel.go:98: Unable to determine import path from :   
Usage:
  revel [OPTIONS] run [run-OPTIONS]

Application Options:
  -v, --debug                 If set the logger is set to verbose
      --historic-run-mode     If set the runmode is passed a string not json
      --historic-build-mode   If set the code is scanned using the original parsers, not the go.1.11+
  -X, --build-flags=          These flags will be used when building the application. May be specified multiple times, only applicable for Build, Run, Package, Test
                              commands
      --gomod-flags=          These flags will execute go mod commands for each flag, this happens during the build process

Help Options:
  -h, --help                  Show this help message

[run command options]
      -a, --application-path= Path to application folder
      -m, --run-mode=         The mode to run the application in
      -p, --port=             The port to listen (default: -1)
      -n, --no-proxy          True if proxy server should not be started. This will only update the main and routes files on change

I miss something ?

Make examples run on docker containers.

How about making examples runnable through docker containers? by that it'll be platform agnostic and anyone can get the example app up and running easily with only docker-compose up by also keeping the device clean

email signup/ forgot password validation ?

im very new to this golang, in the examples , do you have any code that provides email notifications that can send emails out for signup/ forgot password validation ?

No routes found

$ go get github.com/revel/samples/...
package github.com/revel/samples/booking/app/controllers
imports github.com/revel/samples/booking/app/routes: cannot find package "github.com/revel/samples/booking/app/routes" in any of:
/usr/local/go/src/github.com/revel/samples/booking/app/routes (from $GOROOT)
/Users/802619/soft/golang/src/github.com/revel/samples/booking/app/routes (from $GOPATH)
package github.com/revel/samples/chat/app/controllers
imports github.com/revel/samples/chat/app/routes: cannot find package "github.com/revel/samples/chat/app/routes" in any of:
/usr/local/go/src/github.com/revel/samples/chat/app/routes (from $GOROOT)
/Users/802619/soft/golang/src/github.com/revel/samples/chat/app/routes (from $GOPATH)
go: missing Mercurial command. See https://golang.org/s/gogetcmd
package github.com/revel/samples/facebook-oauth2/app/controllers
imports code.google.com/p/goauth2/oauth: exec: "hg": executable file not found in $PATH
package github.com/revel/samples/upload/app/controllers
imports github.com/revel/samples/upload/app/routes: cannot find package "github.com/revel/samples/upload/app/routes" in any of:
/usr/local/go/src/github.com/revel/samples/upload/app/routes (from $GOROOT)
/Users/802619/soft/golang/src/github.com/revel/samples/upload/app/routes (from $GOPATH)

Build error: Unknown Escape Sequence

On Windows, when I try to run this command in cmd revel run "%GOPATH%/github.com/revel/examples/chat", I got:

Revel executing: run a Revel application
WARN  10:07:40    run.go:150: No http.addr specified in the app.conf listening on localhost interface only. This will not allow external access to your application
C:\Users\Administrator\go\src\github.com\revel\examples\chat\app\tmp\main.go
ERROR 10:07:40 watcher.go:270: Build detected an error                   error="Go Compilation Error (in app\\tmp\\main.go:9): unknown escape sequence"

I have no idea what problem I ran into, until I open the main.go file with an ide and got this:
image

Imo, to indicate the file location, the syntax should be github.com/revel/examples/chat/app/tmp/run", yet some how revel just change it to "github.com\revel\examples\chat/app/tmp/run" all the time, rendering the "Unknown escape sequence" error.

Anyone has any idea how to fix this?

No booking/app/routes file in application

I'm not really sure how this application is supposed to run when the import:
github.com/reve/samples/booking/app/routes does not exist. I've attempted to point it at the config/routes file, but since that's not a .go file, it obviously won't work. What is an app/routes file in revel supposed to look like? Is it a simple map, or is it more complex?

Can't compile booking

Hey guys,
Long time no talk to.
Impressed with how far the project has come over the last year, and thought I would try it out again.

Had a couple of easy, minor issues with dependencies, but was able to resolve them.

Now I'm having an issue with the booking app not compiling.

Here's my stack trace:

ERROR 2015/10/23 03:48:10 build.go:101: # github.com/revel/modules/jobs/app/jobs
../src/github.com/revel/modules/jobs/app/jobs/job.go:4: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/modules/static/app/controllers
../src/github.com/revel/modules/static/app/controllers/static.go:4: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/samples/booking/app
../src/github.com/revel/samples/booking/app/init.go:3: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/modules/db/app
../src/github.com/revel/modules/db/app/db.go:14: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/samples/booking/app/models
../src/github.com/revel/samples/booking/app/models/booking.go:5: import /home/m/go_path/pkg/linux_amd64/github.com/go-gorp/gorp.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/samples/booking/app/routes
../src/github.com/revel/samples/booking/app/routes/routes.go:4: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]

What am I doing wrong?

Thanks.

Preserve contributors & commits info

G'day, @brendensoares. Can we preserve the contributors & commits info for samples and modules repos? Check out my samples fork. All commits are there as well as contributors. I cannot PR from my fork as revel:master and anonx:master are entirely different commit histories and I have no rights to force push to revel/samples.

Websocket closing down on chat messages in 0.19

The issue seems to be arising from this commit: revel/revel@cf64e7b

The WebSocket connection closes down when a message is sent in the chat example using "Demonstration" mode as "WebSocket".

Error message in Google Chrome 62.0.3202.75:

WebSocket is already in CLOSING or CLOSED state.

Chat Error websocket

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x4a5375]

goroutine 65 [running]:
code.google.com/p/go.net/websocket.Codec.Receive(0x9b6548, 0x9b6550, 0xc208082090, 0x7558e0, 0xc20818c2d0, 0x0, 0x0)
/home/nilton/GO/src/code.google.com/p/go.net/websocket/websocket.go:314 +0x185
chat/app/controllers.func·001()
/home/nilton/GO/src/chat/app/controllers/websocket.go:39 +0x92
created by chat/app/controllers.WebSocket.RoomSocket
/home/nilton/GO/src/chat/app/controllers/websocket.go:46 +0x3ea

goroutine 1 [IO wait]:
net.(_pollDesc).Wait(0xc2080de060, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(_pollDesc).WaitRead(0xc2080de060, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(_netFD).accept(0xc2080de000, 0x0, 0x7fc700e00db0, 0xc20818c010)
/usr/local/go/src/net/fd_unix.go:419 +0x40b
net.(_TCPListener).AcceptTCP(0xc20802c060, 0xc20813db68, 0x0, 0x0)
/usr/local/go/src/net/tcpsock_posix.go:234 +0x4e
net.(_TCPListener).Accept(0xc20802c060, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/tcpsock_posix.go:244 +0x4c
net/http.(_Server).Serve(0xc208064300, 0x7fc700e02b18, 0xc20802c060, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:1728 +0x92
github.com/revel/revel.Run(0xa9da)
/home/nilton/GO/src/github.com/revel/revel/server.go:129 +0xb01
main.main()
/home/nilton/GO/src/chat/app/tmp/main.go:229 +0x2ec7

goroutine 5 [select]:
chat/app/chatroom.chatroom()
/home/nilton/GO/src/chat/app/chatroom/chatroom.go:66 +0x678
created by chat/app/chatroom.init·1
/home/nilton/GO/src/chat/app/chatroom/chatroom.go:97 +0x25

goroutine 33 [syscall]:
syscall.Syscall6(0xe8, 0x9, 0xc208165cb4, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/asm_linux_amd64.s:46 +0x5
syscall.EpollWait(0x9, 0xc208165cb4, 0x7, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:376 +0x93
gopkg.in/fsnotify%2ev1.(_fdPoller).wait(0xc208118660, 0x0, 0x0, 0x0)
/home/nilton/GO/src/gopkg.in/fsnotify.v1/inotify_poller.go:85 +0xc7
gopkg.in/fsnotify%2ev1.(_Watcher).readEvents(0xc208111a90)
/home/nilton/GO/src/gopkg.in/fsnotify.v1/inotify.go:179 +0x16f
created by gopkg.in/fsnotify%2ev1.NewWatcher
/home/nilton/GO/src/gopkg.in/fsnotify.v1/inotify.go:58 +0x32b

goroutine 36 [IO wait]:
net.(_pollDesc).Wait(0xc2080de1b0, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(_pollDesc).WaitRead(0xc2080de1b0, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(_netFD).Read(0xc2080de150, 0xc20800f000, 0x1000, 0x1000, 0x0, 0x7fc700e00db0, 0xc20818cde8)
/usr/local/go/src/net/fd_unix.go:242 +0x40f
net.(_conn).Read(0xc20802c100, 0xc20800f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/local/go/src/net/net.go:121 +0xdc
net/http.(_liveSwitchReader).Read(0xc2080664a8, 0xc20800f000, 0x1000, 0x1000, 0x742, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:214 +0xab
io.(_LimitedReader).Read(0xc208118160, 0xc20800f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/local/go/src/io/io.go:408 +0xce
bufio.(_Reader).fill(0xc208064960)
/usr/local/go/src/bufio/bufio.go:97 +0x1ce
bufio.(_Reader).ReadSlice(0xc208064960, 0xc2080b3a0a, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:295 +0x257
bufio.(_Reader).ReadLine(0xc208064960, 0x0, 0x0, 0x0, 0xc2080b8500, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:324 +0x62
net/textproto.(_Reader).readLineSlice(0xc208120b70, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/textproto/reader.go:55 +0x9e
net/textproto.(_Reader).ReadLine(0xc208120b70, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/textproto/reader.go:36 +0x4f
net/http.ReadRequest(0xc208064960, 0xc20818e750, 0x0, 0x0)
/usr/local/go/src/net/http/request.go:598 +0xcb
net/http.(_conn).readRequest(0xc208066460, 0x0, 0x0, 0x0)
/usr/local/go/src/net/http/server.go:586 +0x26f
net/http.(_conn).serve(0xc208066460)
/usr/local/go/src/net/http/server.go:1162 +0x69e
created by net/http.(_Server).Serve
/usr/local/go/src/net/http/server.go:1751 +0x35e

goroutine 64 [runnable]:
chat/app/controllers.WebSocket.RoomSocket(0xc208072840, 0xc20817a0b0, 0x6, 0xc208082090, 0x0, 0x0)
/home/nilton/GO/src/chat/app/controllers/websocket.go:50 +0x624
chat/app/controllers.(_WebSocket).RoomSocket(0xc20802c080, 0xc20817a0b0, 0x6, 0xc208082090, 0x0, 0x0)
:145 +0xcd
reflect.Value.call(0x89c900, 0xc20802c080, 0x2113, 0x8bad90, 0x4, 0xc20817a420, 0x2, 0x2, 0x0, 0x0, ...)
/usr/local/go/src/reflect/value.go:419 +0x10e5
reflect.Value.Call(0x89c900, 0xc20802c080, 0x2113, 0xc20817a420, 0x2, 0x2, 0x0, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:296 +0xbc
github.com/revel/revel.ActionInvoker(0xc208072840, 0xc208065af8, 0x0, 0x0)
/home/nilton/GO/src/github.com/revel/revel/invoker.go:36 +0x594
github.com/revel/revel.CompressFilter(0xc208072840, 0xc208065af8, 0x1, 0x1)
/home/nilton/GO/src/github.com/revel/revel/compress.go:47 +0xa2
github.com/revel/revel.InterceptorFilter(0xc208072840, 0xc208065af0, 0x2, 0x2)
/home/nilton/GO/src/github.com/revel/revel/intercept.go:103 +0x114
github.com/revel/revel.I18nFilter(0xc208072840, 0xc208065ae8, 0x3, 0x3)
/home/nilton/GO/src/github.com/revel/revel/i18n.go:155 +0x2d7
github.com/revel/revel.ValidationFilter(0xc208072840, 0xc208065ae0, 0x4, 0x4)
/home/nilton/GO/src/github.com/revel/revel/validation.go:191 +0x1e4
github.com/revel/revel.FlashFilter(0xc208072840, 0xc208065ad8, 0x5, 0x5)
/home/nilton/GO/src/github.com/revel/revel/flash.go:46 +0x17c
github.com/revel/revel.SessionFilter(0xc208072840, 0xc208065ad0, 0x6, 0x6)
/home/nilton/GO/src/github.com/revel/revel/session.go:149 +0x148
github.com/revel/revel.ParamsFilter(0xc208072840, 0xc208065ac8, 0x7, 0x7)
/home/nilton/GO/src/github.com/revel/revel/params.go:133 +0xd9
github.com/revel/revel.FilterConfiguringFilter(0xc208072840, 0xc208065ac0, 0x8, 0x8)
/home/nilton/GO/src/github.com/revel/revel/filterconfig.go:208 +0x212
github.com/revel/revel.RouterFilter(0xc208072840, 0xc208065ab8, 0x9, 0x9)
/home/nilton/GO/src/github.com/revel/revel/router.go:474 +0x65c
github.com/revel/revel.PanicFilter(0xc208072840, 0xc208065ab0, 0xa, 0xa)
/home/nilton/GO/src/github.com/revel/revel/panic.go:15 +0xb6
github.com/revel/revel.func·031(0xc208072840, 0xc208065aa8, 0xb, 0xb)
/home/nilton/GO/src/github.com/revel/revel/watcher.go:232 +0x16e
github.com/revel/revel.handleInternal(0x7fc700e03ce0, 0xc208180000, 0xc20818e0d0, 0xc208082000)
/home/nilton/GO/src/github.com/revel/revel/server.go:50 +0x3ee
github.com/revel/revel.func·046(0xc208082000)
/home/nilton/GO/src/github.com/revel/revel/server.go:35 +0xf1
golang.org/x/net/websocket.Server.serveWebSocket(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x9b6a78, ...)
/home/nilton/GO/src/golang.org/x/net/websocket/server.go:90 +0x292
golang.org/x/net/websocket.Handler.ServeHTTP(0xc208198180, 0x7fc700e03ce0, 0xc208180000, 0xc20818e0d0)
/home/nilton/GO/src/golang.org/x/net/websocket/server.go:113 +0x8a
github.com/revel/revel.handle(0x7fc700e03ce0, 0xc208180000, 0xc20818e0d0)
/home/nilton/GO/src/github.com/revel/revel/server.go:36 +0x31e
net/http.HandlerFunc.ServeHTTP(0x9b6a18, 0x7fc700e03ce0, 0xc208180000, 0xc20818e0d0)
/usr/local/go/src/net/http/server.go:1265 +0x41
net/http.serverHandler.ServeHTTP(0xc208064300, 0x7fc700e03ce0, 0xc208180000, 0xc20818e0d0)
/usr/local/go/src/net/http/server.go:1703 +0x19a
net/http.(_conn).serve(0xc208180f00)
/usr/local/go/src/net/http/server.go:1204 +0xb57
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:1751 +0x35e

Running booking example throws build error

I have cloned the examples in to my src github but when I try and run the booking example I get the following error

ERROR 13:16:41 harness.go:239: Build detected an error error="Go Compilation Error (in ../../../../../pkg/mod/github.com/revel/[email protected]/orm/gorp/app/dbgorp.go:7): no matching versions for query "latest""

Error compiling code, to view error details see proxy running on http://0.0.0.0:9000

Time to recompile 2.102759448s
Any ideas how to fix this

Thanks

BTW the other examples throw even more errors

Cannot get examples to run

Following the documentation I was not able to run booking example.

  • I have go.
  • I have revel in $GOPATH/src/github.com/revel/revel from go get github.com/revel/revel ; there are other dependencies installed in revel dir too.
  • I have cloned this repo in another place and running revel run booking yields "import relative to unknown directory"
  • I tried installing the examples like I did revel go get github.com/revel/examples yields "package github.com/revel/examples: no Go files in [...]"
  • I tried moving the cloned "examples" dir to $GOPATH/src/github.com/revel and start it as in README with go run github.com/reve/examples/booking ; it yields "go run: no go files listed"
  • I tried various other methods to get the example started that I don't think will help this issue further so I won't enumerate them.

Can you elaborate on how to run the examples ?
Thanks!

Hotel Booking Example : how to compile sqlite3

I am trying to run the revel example "Hotel Booking".
The information on the example page are not mentioning how to install sqlite, and I am facing some problems. (the sqlite3 page is not very helpfull either). I have gcc on my machine
It tried to install go sqlite, but It is not working :

go get github.com/mattn/go-sqlite3

github.com/mattn/go-sqlite3

../../../mattn/go-sqlite3/sqlite3_go18.go:26: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:35: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:49: undefined: driver.TxOptions
../../../mattn/go-sqlite3/sqlite3_go18.go:54: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:63: undefined: driver.NamedValue


Then of course when I run the app I get errors:

ERROR 14:08:42 revel build.go:146: # gopkg.in/Masterminds/squirrel.v1
../../../../gopkg.in/Masterminds/squirrel.v1/squirrel_ctx.go:36: r.DB.QueryRowContext undefined (type *sql.DB has no field or method QueryRowContext)
../../../../gopkg.in/Masterminds/squirrel.v1/squirrel_ctx.go:40: r.Tx.QueryRowContext undefined (type *sql.Tx has no field or method QueryRowContext)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher.go:80: cannot use db (type *sql.DB) as type PreparerContext in argument to NewStmtCacher:
*sql.DB does not implement PreparerContext (missing PrepareContext method)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:57: stmt.ExecContext undefined (type *sql.Stmt has no field or method ExecContext)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:57: not enough arguments to return
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:65: stmt.QueryContext undefined (type *sql.Stmt has no field or method QueryContext)
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:65: not enough arguments to return
../../../../gopkg.in/Masterminds/squirrel.v1/stmtcacher_ctx.go:73: stmt.QueryRowContext undefined (type *sql.Stmt has no field or method QueryRowContext)

github.com/go-sql-driver/mysql

../../../go-sql-driver/mysql/connection_go18.go:43: undefined: driver.TxOptions
../../../go-sql-driver/mysql/connection_go18.go:55: undefined: sql.IsolationLevel
../../../go-sql-driver/mysql/connection_go18.go:55: undefined: sql.LevelDefault
../../../go-sql-driver/mysql/connection_go18.go:69: undefined: driver.NamedValue
../../../go-sql-driver/mysql/connection_go18.go:88: undefined: driver.NamedValue
../../../go-sql-driver/mysql/connection_go18.go:122: undefined: driver.NamedValue
../../../go-sql-driver/mysql/connection_go18.go:141: undefined: driver.NamedValue
../../../go-sql-driver/mysql/utils_go18.go:21: c.Clone undefined (type *tls.Config has no field or method Clone, but does have tls.clone)
../../../go-sql-driver/mysql/utils_go18.go:24: undefined: driver.NamedValue
../../../go-sql-driver/mysql/utils_go18.go:36: undefined: driver.IsolationLevel
../../../go-sql-driver/mysql/utils_go18.go:21: too many errors

github.com/lib/pq

../../../lib/pq/conn_go18.go:15: undefined: driver.NamedValue
../../../lib/pq/conn_go18.go:33: undefined: driver.NamedValue
../../../lib/pq/conn_go18.go:47: undefined: driver.TxOptions
../../../lib/pq/conn_go18.go:50: undefined: sql.IsolationLevel
../../../lib/pq/conn_go18.go:51: undefined: sql.LevelDefault
../../../lib/pq/conn_go18.go:53: undefined: sql.LevelReadUncommitted
../../../lib/pq/conn_go18.go:55: undefined: sql.LevelReadCommitted
../../../lib/pq/conn_go18.go:57: undefined: sql.LevelRepeatableRead
../../../lib/pq/conn_go18.go:59: undefined: sql.LevelSerializable

github.com/mattn/go-sqlite3

../../../mattn/go-sqlite3/sqlite3_go18.go:26: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:35: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:49: undefined: driver.TxOptions
../../../mattn/go-sqlite3/sqlite3_go18.go:54: undefined: driver.NamedValue
../../../mattn/go-sqlite3/sqlite3_go18.go:63: undefined: driver.NamedValue

Question: How does the interceptor for login not get called on every request?

Hey there!

Thanks for all your effort and the good documentation.
I'm currently adapting your example in an own project but I got stuck while implementing the authentication.
I understand what happens in general but the problem i run into is that the checkUser gets called on every request.
If the user is not logged in it redirects to the login page how ever I do not want to the user to need to be authenticated to access the login page. What currently happens that I'm creating an endless loop redirections.

I was looking for an exclusion for the checkUser interceptor in your example project but I couldn't find one. Could you maybe enlighten me on how I could exclude the checkUser for example for the login page? I might also a have misunderstanding in there how that whole things work. So I just thought I'd ask :)

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.