1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-21 17:30:55 +00:00

Merge pull request #4249 from flycash/rft/moveSession

move core/session to web/session
This commit is contained in:
Ming Deng 2020-10-05 19:45:38 +08:00 committed by GitHub
commit ff762b561c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 33 additions and 32 deletions

View File

@ -37,7 +37,7 @@ import (
"net/http"
"github.com/astaxie/beego/pkg/adapter/session"
beecb "github.com/astaxie/beego/pkg/core/session/couchbase"
beecb "github.com/astaxie/beego/pkg/server/web/session/couchbase"
)
// SessionStore store each session

View File

@ -6,7 +6,7 @@ import (
"net/http"
"github.com/astaxie/beego/pkg/adapter/session"
beeLedis "github.com/astaxie/beego/pkg/core/session/ledis"
beeLedis "github.com/astaxie/beego/pkg/server/web/session/ledis"
)
// SessionStore ledis session store

View File

@ -38,7 +38,7 @@ import (
"github.com/astaxie/beego/pkg/adapter/session"
beemem "github.com/astaxie/beego/pkg/core/session/memcache"
beemem "github.com/astaxie/beego/pkg/server/web/session/memcache"
)
// SessionStore memcache session store

View File

@ -45,7 +45,7 @@ import (
"net/http"
"github.com/astaxie/beego/pkg/adapter/session"
"github.com/astaxie/beego/pkg/core/session/mysql"
"github.com/astaxie/beego/pkg/server/web/session/mysql"
// import mysql driver
_ "github.com/go-sql-driver/mysql"

View File

@ -58,7 +58,7 @@ import (
// import postgresql Driver
_ "github.com/lib/pq"
"github.com/astaxie/beego/pkg/core/session/postgres"
"github.com/astaxie/beego/pkg/server/web/session/postgres"
)
// SessionStore postgresql session store

View File

@ -17,7 +17,7 @@ package session
import (
"context"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
type oldToNewProviderAdapter struct {

View File

@ -38,7 +38,7 @@ import (
"github.com/astaxie/beego/pkg/adapter/session"
beeRedis "github.com/astaxie/beego/pkg/core/session/redis"
beeRedis "github.com/astaxie/beego/pkg/server/web/session/redis"
)
// MaxPoolSize redis max pool size

View File

@ -37,7 +37,7 @@ import (
"net/http"
"github.com/astaxie/beego/pkg/adapter/session"
cluster "github.com/astaxie/beego/pkg/core/session/redis_cluster"
cluster "github.com/astaxie/beego/pkg/server/web/session/redis_cluster"
)
// MaxPoolSize redis_cluster max pool size

View File

@ -38,7 +38,7 @@ import (
"github.com/astaxie/beego/pkg/adapter/session"
sentinel "github.com/astaxie/beego/pkg/core/session/redis_sentinel"
sentinel "github.com/astaxie/beego/pkg/server/web/session/redis_sentinel"
)
// DefaultPoolSize redis_sentinel default pool size

View File

@ -18,7 +18,7 @@ import (
"context"
"net/http"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
// CookieSessionStore Cookie SessionStore

View File

@ -18,7 +18,7 @@ import (
"context"
"net/http"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
// FileSessionStore File session store

View File

@ -18,7 +18,7 @@ import (
"context"
"net/http"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
// MemSessionStore memory session store.

View File

@ -15,7 +15,7 @@
package session
import (
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
// EncodeGob encode the obj to gob

View File

@ -32,7 +32,7 @@ import (
"net/http"
"os"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
// Store contains all data for one session process with specific id.

View File

@ -6,7 +6,7 @@ import (
"github.com/astaxie/beego/pkg/adapter/session"
beeSsdb "github.com/astaxie/beego/pkg/core/session/ssdb"
beeSsdb "github.com/astaxie/beego/pkg/server/web/session/ssdb"
)
// Provider holds ssdb client and configs

View File

@ -18,7 +18,7 @@ import (
"context"
"net/http"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
type NewToOldStoreAdapter struct {

View File

@ -27,7 +27,7 @@ import (
"github.com/astaxie/beego/pkg"
"github.com/astaxie/beego/pkg/core/config"
"github.com/astaxie/beego/pkg/core/logs"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
"github.com/astaxie/beego/pkg/core/utils"
"github.com/astaxie/beego/pkg/server/web/context"

View File

@ -29,7 +29,7 @@ import (
"strings"
"sync"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
// Regexes for checking the accept headers

View File

@ -28,7 +28,7 @@ import (
"strconv"
"strings"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
"github.com/astaxie/beego/pkg/server/web/context"
"github.com/astaxie/beego/pkg/server/web/context/param"

View File

@ -8,8 +8,8 @@ import (
"path/filepath"
"github.com/astaxie/beego/pkg/core/logs"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/context"
"github.com/astaxie/beego/pkg/server/web/session"
)
// register MIME type with content type

View File

@ -40,7 +40,7 @@ import (
couchbase "github.com/couchbase/go-couchbase"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
var couchbpder = &Provider{}

View File

@ -11,7 +11,7 @@ import (
"github.com/ledisdb/ledisdb/config"
"github.com/ledisdb/ledisdb/ledis"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
var (

View File

@ -38,7 +38,7 @@ import (
"strings"
"sync"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
"github.com/bradfitz/gomemcache/memcache"
)

View File

@ -47,7 +47,7 @@ import (
"sync"
"time"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
// import mysql driver
_ "github.com/go-sql-driver/mysql"
)

View File

@ -57,7 +57,7 @@ import (
"sync"
"time"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
// import postgresql Driver
_ "github.com/lib/pq"
)

View File

@ -40,7 +40,7 @@ import (
"sync"
"time"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
"github.com/go-redis/redis/v7"
)

View File

@ -7,7 +7,7 @@ import (
"os"
"testing"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
func TestRedis(t *testing.T) {

View File

@ -40,7 +40,7 @@ import (
"sync"
"time"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
rediss "github.com/go-redis/redis/v7"
)

View File

@ -40,7 +40,7 @@ import (
"sync"
"time"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
"github.com/go-redis/redis/v7"
)

View File

@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"
"github.com/astaxie/beego/pkg/core/session"
"github.com/astaxie/beego/pkg/server/web/session"
)
func TestRedisSentinel(t *testing.T) {

View File

@ -8,8 +8,9 @@ import (
"strings"
"sync"
"github.com/astaxie/beego/pkg/core/session"
"github.com/ssdb/gossdb/ssdb"
"github.com/astaxie/beego/pkg/server/web/session"
)
var ssdbProvider = &Provider{}
@ -87,7 +88,7 @@ func (p *Provider) SessionExist(ctx context.Context, sid string) (bool, error) {
// SessionRegenerate regenerate session with new sid and delete oldsid
func (p *Provider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error) {
//conn.Do("setx", key, v, ttl)
// conn.Do("setx", key, v, ttl)
if p.client == nil {
if err := p.connectInit(); err != nil {
return nil, err