Skip to content

Commit

Permalink
Renamed sqlstore connector in sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
markdicksonjr committed Dec 28, 2018
1 parent c55fee1 commit 505943b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions session/connectors/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/wader/gormstore"
)

type SqlMemoryStoreConnector struct {
type SqlStoreConnector struct {
SqlExtension *sql.Extension
Secret string
MaxAgeMs int
Expand All @@ -17,7 +17,7 @@ type SqlMemoryStoreConnector struct {
db *gorm.DB
}

func (s SqlMemoryStoreConnector) Connect() (error, sessions.Store) {
func (s SqlStoreConnector) Connect() (error, sessions.Store) {

// if no DB provided, use sqlite3 memory DB
if s.SqlExtension == nil {
Expand Down Expand Up @@ -46,7 +46,7 @@ func (s SqlMemoryStoreConnector) Connect() (error, sessions.Store) {
return nil, store
}

func (s SqlMemoryStoreConnector) MaxAge() int {
func (s SqlStoreConnector) MaxAge() int {
if s.MaxAgeMs == 0 {
return 60 * 60 * 24 * 15 // 15 days
}
Expand Down
2 changes: 1 addition & 1 deletion session/sample/sample.application.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func main() {
}

// allocate session extension, with an optional custom connector
var sessionConnector session.SessionStoreConnector = &connectors.SqlMemoryStoreConnector{
var sessionConnector session.SessionStoreConnector = &connectors.SqlStoreConnector{
Secret: "somesecret",
SqlExtension: sqlController.SqlExtension,
}
Expand Down
2 changes: 1 addition & 1 deletion user/auth/auth0/sample/sample.application.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func main() {
// allocate session extension
sessionExtension := session.Extension{
SessionName: "auth0",
StoreConnector: connectors.SqlMemoryStoreConnector{
StoreConnector: connectors.SqlStoreConnector{
SqlExtension: &sqlExtension,
Secret: "somesecret",
},
Expand Down
2 changes: 1 addition & 1 deletion user/auth/local/sample/sample.application.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func main() {
}

// allocate session extension
connector := connectors.SqlMemoryStoreConnector{
connector := connectors.SqlStoreConnector{
SqlExtension: &sqlExtension,
Secret: "dumbsecret",
}
Expand Down

0 comments on commit 505943b

Please sign in to comment.