Skip to content

Commit

Permalink
Add flash messages and more
Browse files Browse the repository at this point in the history
  • Loading branch information
kataras committed Dec 29, 2016
1 parent 59d2310 commit d7ae81e
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 20 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Quick view
-----------

```go
import "github.com/kataras/go-sessions"
import "gopkg.in/kataras/go-sessions.v0"

sess := sessions.Start(http.ResponseWriter, *http.Request)
sess.
Expand Down Expand Up @@ -56,7 +56,7 @@ Installation
The only requirement is the [Go Programming Language](https://golang.org/dl), at least v1.7.

```bash
$ go get -u github.com/kataras/go-sessions
$ go get -u gopkg.in/kataras/go-sessions.v0
```

Features
Expand All @@ -65,14 +65,14 @@ Features
- Flash messages
- Cleans the temp memory when a session is idle, and re-allocates it to the temp memory when it's necessary.
- The most used sessions are optimized to be in the front of the memory's list.
- Supports any type of [external database](https://github.com/kataras/go-sessions/tree/master/_examples/3_redis_sessiondb).
- Supports any type of [external database](https://github.com/kataras/go-sessions/tree/0.0.7/_examples/3_redis_sessiondb).
- Works with both [net/http](https://golang.org/pkg/net/http/) and [valyala/fasthttp](https://github.com/valyala/fasthttp).


Docs
------------

Take a look at the [./examples](https://github.com/kataras/go-sessions/tree/master/_examples).
Take a look at the [./examples](https://github.com/kataras/go-sessions/tree/0.0.7/_examples).


**OUTLINE**
Expand All @@ -90,7 +90,7 @@ DestroyFasthttp(*fasthttp.RequestCtx)

// UseDatabase ,optionally, adds a session database to the manager's provider,
// a session db doesn't have write access
// see https://github.com/kataras/go-sessions/tree/master/sessiondb
// see https://github.com/kataras/go-sessions/tree/0.0.7/sessiondb
UseDatabase(Database)

// UpdateConfig updates the configuration field (Config does not receives a pointer, so this is a way to update a pre-defined configuration)
Expand Down Expand Up @@ -132,7 +132,7 @@ package main

import (
"fmt"
"github.com/kataras/go-sessions"
"gopkg.in/kataras/go-sessions.v0"
"net/http"
)

Expand Down Expand Up @@ -220,7 +220,7 @@ package main

import (
"fmt"
"github.com/kataras/go-sessions"
"gopkg.in/kataras/go-sessions.v0"
"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion _examples/1_simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main

import (
"fmt"
"github.com/kataras/go-sessions"
"gopkg.in/kataras/go-sessions.v0"
"net/http"
)

Expand Down
2 changes: 1 addition & 1 deletion _examples/2_custom_manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main

import (
"fmt"
"github.com/kataras/go-sessions"
"gopkg.in/kataras/go-sessions.v0"
"net/http"
"time"
)
Expand Down
6 changes: 3 additions & 3 deletions _examples/3_redis_sessiondb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package main

import (
"fmt"
"github.com/kataras/go-sessions"
"github.com/kataras/go-sessions/sessiondb/redis"
"github.com/kataras/go-sessions/sessiondb/redis/service"
"gopkg.in/kataras/go-sessions.v0"
"gopkg.in/kataras/go-sessions.v0/sessiondb/redis"
"gopkg.in/kataras/go-sessions.v0/sessiondb/redis/service"
"net/http"
"time"
)
Expand Down
4 changes: 2 additions & 2 deletions _examples/4_leveldb_session/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"syscall"
"time"

"github.com/kataras/go-sessions"
"github.com/kataras/go-sessions/sessiondb/leveldb"
"gopkg.in/kataras/go-sessions.v0"
"gopkg.in/kataras/go-sessions.v0/sessiondb/leveldb"
)

var mySessionsConfig = sessions.Config{Cookie: "mysessioncookieid",
Expand Down
4 changes: 3 additions & 1 deletion _examples/5_flash_messages/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// +build ignore

package main

import (
"fmt"
"net/http"

"github.com/kataras/go-sessions"
"gopkg.in/kataras/go-sessions.v0"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/fasthttp_simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package main

import (
"fmt"
"github.com/kataras/go-sessions"
"github.com/valyala/fasthttp"
"gopkg.in/kataras/go-sessions.v0"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion sessiondb/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"time"

"github.com/kataras/go-sessions/sessiondb/leveldb/record"
"gopkg.in/kataras/go-sessions.v0/sessiondb/leveldb/record"

"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
Expand Down
2 changes: 1 addition & 1 deletion sessiondb/redis/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/gob"

"github.com/kataras/go-sessions/sessiondb/redis/service"
"gopkg.in/kataras/go-sessions.v0/sessiondb/redis/service"
)

// Database the redis database for q sessions
Expand Down
4 changes: 2 additions & 2 deletions sessions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"
"testing"

"github.com/gavv/httpexpect"
"github.com/kataras/go-errors"
"github.com/kataras/go-serializer"
"gopkg.in/gavv/httpexpect.v1"
"gopkg.in/kataras/go-serializer.v0"
)

var errReadBody = errors.New("While trying to read %s from the request body. Trace %s")
Expand Down

0 comments on commit d7ae81e

Please sign in to comment.