Documentation
¶
Overview ¶
Package spanner provides the session storage driver for Spanner.
Index ¶
- type ConnectionSettings
- type SessionStorageDriver
- func (s *SessionStorageDriver) ActivateUser(ctx context.Context, id ccc.UUID) error
- func (s *SessionStorageDriver) CreateUser(ctx context.Context, insertUser *dbtype.InsertSessionUser) (*dbtype.SessionUser, error)
- func (s *SessionStorageDriver) DeactivateUser(ctx context.Context, id ccc.UUID) error
- func (s *SessionStorageDriver) DeleteUser(ctx context.Context, id ccc.UUID) error
- func (s *SessionStorageDriver) DestroyAllUserSessions(ctx context.Context, username string) error
- func (s *SessionStorageDriver) DestroySession(ctx context.Context, sessionID ccc.UUID) error
- func (s *SessionStorageDriver) DestroySessionOIDC(ctx context.Context, oidcSID string) error
- func (s *SessionStorageDriver) InsertSession(ctx context.Context, insertSession *dbtype.InsertSession) (ccc.UUID, error)
- func (s *SessionStorageDriver) InsertSessionOIDC(ctx context.Context, insertSession *dbtype.InsertOIDCSession) (ccc.UUID, error)
- func (s *SessionStorageDriver) Session(ctx context.Context, sessionID ccc.UUID) (*dbtype.Session, error)
- func (s *SessionStorageDriver) SetSessionTableName(name string)
- func (s *SessionStorageDriver) SetUserPasswordHash(ctx context.Context, userID ccc.UUID, hash *securehash.Hash) error
- func (s *SessionStorageDriver) SetUserTableName(name string)
- func (s *SessionStorageDriver) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error
- func (s *SessionStorageDriver) User(ctx context.Context, id ccc.UUID) (*dbtype.SessionUser, error)
- func (s *SessionStorageDriver) UserByUserName(ctx context.Context, username string) (*dbtype.SessionUser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionSettings ¶
type ConnectionSettings struct {
// ProjectID is the project the Spanner database is in
ProjectID string
// InstanceID is the Spanner Instance ID
InstanceID string
// DatabaseName is the Spanner Database Name
DatabaseName string
}
ConnectionSettings is used to configure the spanner package
func (*ConnectionSettings) DBName ¶
func (c *ConnectionSettings) DBName() string
DBName returns the fully qualified database name.
type SessionStorageDriver ¶
type SessionStorageDriver struct {
// contains filtered or unexported fields
}
SessionStorageDriver represents the session storage implementation for Spanner.
func NewSessionStorageDriver ¶
func NewSessionStorageDriver(client *spanner.Client) *SessionStorageDriver
NewSessionStorageDriver creates a new SessionStorageDriver
func (*SessionStorageDriver) ActivateUser ¶ added in v0.6.2
ActivateUser activates a user
func (*SessionStorageDriver) CreateUser ¶ added in v0.6.2
func (s *SessionStorageDriver) CreateUser(ctx context.Context, insertUser *dbtype.InsertSessionUser) (*dbtype.SessionUser, error)
CreateUser creates a new user
func (*SessionStorageDriver) DeactivateUser ¶ added in v0.6.2
DeactivateUser deactivates a user
func (*SessionStorageDriver) DeleteUser ¶ added in v0.6.2
DeleteUser deletes a user
func (*SessionStorageDriver) DestroyAllUserSessions ¶ added in v0.6.2
func (s *SessionStorageDriver) DestroyAllUserSessions(ctx context.Context, username string) error
DestroyAllUserSessions destroys all sessions for a given user
func (*SessionStorageDriver) DestroySession ¶
DestroySession marks the session as expired
func (*SessionStorageDriver) DestroySessionOIDC ¶
func (s *SessionStorageDriver) DestroySessionOIDC(ctx context.Context, oidcSID string) error
DestroySessionOIDC marks the session as expired using the oidcSID
func (*SessionStorageDriver) InsertSession ¶
func (s *SessionStorageDriver) InsertSession(ctx context.Context, insertSession *dbtype.InsertSession) (ccc.UUID, error)
InsertSession inserts a Session into database
func (*SessionStorageDriver) InsertSessionOIDC ¶
func (s *SessionStorageDriver) InsertSessionOIDC(ctx context.Context, insertSession *dbtype.InsertOIDCSession) (ccc.UUID, error)
InsertSessionOIDC inserts a Session into database
func (*SessionStorageDriver) Session ¶
func (s *SessionStorageDriver) Session(ctx context.Context, sessionID ccc.UUID) (*dbtype.Session, error)
Session returns the session information from the database for given sessionID
func (*SessionStorageDriver) SetSessionTableName ¶ added in v0.6.1
func (s *SessionStorageDriver) SetSessionTableName(name string)
SetSessionTableName sets the name of the session table.
func (*SessionStorageDriver) SetUserPasswordHash ¶ added in v0.6.1
func (s *SessionStorageDriver) SetUserPasswordHash(ctx context.Context, userID ccc.UUID, hash *securehash.Hash) error
SetUserPasswordHash updates the user password hash
func (*SessionStorageDriver) SetUserTableName ¶ added in v0.6.1
func (s *SessionStorageDriver) SetUserTableName(name string)
SetUserTableName sets the name of the user table.
func (*SessionStorageDriver) UpdateSessionActivity ¶
UpdateSessionActivity updates the session activity column with the current time
func (*SessionStorageDriver) User ¶ added in v0.6.1
func (s *SessionStorageDriver) User(ctx context.Context, id ccc.UUID) (*dbtype.SessionUser, error)
User returns the user record associated with the user id
func (*SessionStorageDriver) UserByUserName ¶ added in v0.6.1
func (s *SessionStorageDriver) UserByUserName(ctx context.Context, username string) (*dbtype.SessionUser, error)
UserByUserName returns the user record associated with the username