spanner

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package spanner provides the session storage driver for Spanner.

Index

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

func (s *SessionStorageDriver) ActivateUser(ctx context.Context, id ccc.UUID) error

ActivateUser activates a user

func (*SessionStorageDriver) CreateUser added in v0.6.2

CreateUser creates a new user

func (*SessionStorageDriver) DeactivateUser added in v0.6.2

func (s *SessionStorageDriver) DeactivateUser(ctx context.Context, id ccc.UUID) error

DeactivateUser deactivates a user

func (*SessionStorageDriver) DeleteUser added in v0.6.2

func (s *SessionStorageDriver) DeleteUser(ctx context.Context, id ccc.UUID) error

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

func (s *SessionStorageDriver) DestroySession(ctx context.Context, sessionID ccc.UUID) error

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) SetUserUsername added in v0.7.4

func (s *SessionStorageDriver) SetUserUsername(ctx context.Context, userID ccc.UUID, username string) error

SetUserUsername updates the user username

func (*SessionStorageDriver) UpdateSessionActivity

func (s *SessionStorageDriver) UpdateSessionActivity(ctx context.Context, sessionID ccc.UUID) error

UpdateSessionActivity updates the session activity column with the current time

func (*SessionStorageDriver) User added in v0.6.1

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL