Documentation
¶
Index ¶
- func RunMigrations(ctx context.Context, db *sql.DB) error
- type APIKeyAuthRecord
- type APIKeyRecord
- type Adapter
- type ApplicationRecord
- type BrowserSessionRecord
- type Config
- type PostgresAdapter
- type SQLiteAdapter
- type SessionRecord
- type Store
- func (s *Store) CountUsers(ctx context.Context) (int, error)
- func (s *Store) CreateAPIKey(ctx context.Context, record APIKeyRecord) error
- func (s *Store) CreateApplication(ctx context.Context, record ApplicationRecord) error
- func (s *Store) CreateBrowserSession(ctx context.Context, record BrowserSessionRecord) error
- func (s *Store) CreateSession(ctx context.Context, record SessionRecord) error
- func (s *Store) CreateUser(ctx context.Context, record UserRecord) error
- func (s *Store) DeleteExpiredSessions(ctx context.Context, now time.Time) error
- func (s *Store) DeleteSessionByTokenHash(ctx context.Context, tokenHash string) error
- func (s *Store) GetActiveAPIKeyAuthByHash(ctx context.Context, keyHash string) (APIKeyAuthRecord, bool, error)
- func (s *Store) GetApplicationByID(ctx context.Context, applicationID string) (ApplicationRecord, bool, error)
- func (s *Store) GetBrowserSessionByExternalID(ctx context.Context, applicationID string, externalBrowserID string) (BrowserSessionRecord, bool, error)
- func (s *Store) GetSessionWithUserByTokenHash(ctx context.Context, tokenHash string) (SessionRecord, UserRecord, bool, error)
- func (s *Store) GetUserByEmail(ctx context.Context, email string) (UserRecord, bool, error)
- func (s *Store) GetUserByID(ctx context.Context, userID string) (UserRecord, bool, error)
- func (s *Store) ListAPIKeysByApplicationID(ctx context.Context, applicationID string) ([]APIKeyRecord, error)
- func (s *Store) ListApplicationsByUserID(ctx context.Context, userID string) ([]ApplicationRecord, error)
- func (s *Store) ListBrowserSessionsByApplicationID(ctx context.Context, applicationID string) ([]BrowserSessionRecord, error)
- func (s *Store) ListBrowserSessionsByUserID(ctx context.Context, userID string, limit int) ([]BrowserSessionRecord, error)
- func (s *Store) ListUsers(ctx context.Context, limit int) ([]UserRecord, error)
- func (s *Store) MarkBrowserSessionCompleted(ctx context.Context, applicationID string, externalBrowserID string, ...) error
- func (s *Store) RevokeAPIKey(ctx context.Context, applicationID string, keyID string, revokedAt time.Time) (bool, error)
- func (s *Store) TouchAPIKeyLastUsed(ctx context.Context, keyID string, usedAt time.Time) error
- func (s *Store) UpdateBrowserSessionHeartbeat(ctx context.Context, applicationID string, externalBrowserID string, ...) error
- type UserRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyAuthRecord ¶
type APIKeyAuthRecord struct {
Key APIKeyRecord
Application ApplicationRecord
}
type APIKeyRecord ¶
type Adapter ¶
type Adapter interface {
Name() string
DriverName() string
DefaultDSN() string
NormalizeDSN(input string) string
}
func ResolveAdapter ¶
type ApplicationRecord ¶
type BrowserSessionRecord ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() Config
type PostgresAdapter ¶
type PostgresAdapter struct{}
func (PostgresAdapter) DefaultDSN ¶
func (PostgresAdapter) DefaultDSN() string
func (PostgresAdapter) DriverName ¶
func (PostgresAdapter) DriverName() string
func (PostgresAdapter) Name ¶
func (PostgresAdapter) Name() string
func (PostgresAdapter) NormalizeDSN ¶
func (PostgresAdapter) NormalizeDSN(input string) string
type SQLiteAdapter ¶
type SQLiteAdapter struct{}
func (SQLiteAdapter) DefaultDSN ¶
func (SQLiteAdapter) DefaultDSN() string
func (SQLiteAdapter) DriverName ¶
func (SQLiteAdapter) DriverName() string
func (SQLiteAdapter) Name ¶
func (SQLiteAdapter) Name() string
func (SQLiteAdapter) NormalizeDSN ¶
func (SQLiteAdapter) NormalizeDSN(input string) string
type SessionRecord ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CreateAPIKey ¶
func (s *Store) CreateAPIKey(ctx context.Context, record APIKeyRecord) error
func (*Store) CreateApplication ¶
func (s *Store) CreateApplication(ctx context.Context, record ApplicationRecord) error
func (*Store) CreateBrowserSession ¶
func (s *Store) CreateBrowserSession(ctx context.Context, record BrowserSessionRecord) error
func (*Store) CreateSession ¶
func (s *Store) CreateSession(ctx context.Context, record SessionRecord) error
func (*Store) CreateUser ¶
func (s *Store) CreateUser(ctx context.Context, record UserRecord) error
func (*Store) DeleteExpiredSessions ¶
func (*Store) DeleteSessionByTokenHash ¶
func (*Store) GetActiveAPIKeyAuthByHash ¶
func (*Store) GetApplicationByID ¶
func (*Store) GetBrowserSessionByExternalID ¶
func (*Store) GetSessionWithUserByTokenHash ¶
func (s *Store) GetSessionWithUserByTokenHash(ctx context.Context, tokenHash string) (SessionRecord, UserRecord, bool, error)
func (*Store) GetUserByEmail ¶
func (*Store) GetUserByID ¶
func (*Store) ListAPIKeysByApplicationID ¶
func (*Store) ListApplicationsByUserID ¶
func (*Store) ListBrowserSessionsByApplicationID ¶
func (*Store) ListBrowserSessionsByUserID ¶
func (*Store) MarkBrowserSessionCompleted ¶
func (*Store) RevokeAPIKey ¶
func (*Store) TouchAPIKeyLastUsed ¶
func (*Store) UpdateBrowserSessionHeartbeat ¶
Click to show internal directories.
Click to hide internal directories.