database

package
v0.0.0-...-533ea73 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionsMismatch = errors.New("the old and new session do not match")
)

Functions

This section is empty.

Types

type SessionData

type SessionData struct {
	Subject      string
	AccessToken  string
	RefreshToken string
	IDToken      string
	ExpiresAt    time.Time
}

func (SessionData) IsExpired

func (d SessionData) IsExpired() bool

type SessionImpl

type SessionImpl interface {
	CloseConnection(ctx context.Context) error
	Add(context.Context, SessionData) (string, error)
	Delete(context.Context, string) error
	Get(context.Context, string) (SessionData, error)
	Update(context.Context, string, SessionData) error
	Purge(ctx context.Context) error
}

func NewPostgresqlSessionImpl

func NewPostgresqlSessionImpl(ctx context.Context, cipher encryption.HexCipher, host, database, username, password string) (SessionImpl, error)

func NewSQLiteSessionImpl

func NewSQLiteSessionImpl(_ context.Context, cipher encryption.HexCipher, database string) (SessionImpl, error)

Jump to

Keyboard shortcuts

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