database

package
v0.0.0-...-11c1434 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Queries DatabaseQueries
}
var Connection *Database

func ConnectToSelectedDBDriver

func ConnectToSelectedDBDriver(c *config.Config) *Database

type DatabaseQueries

type DatabaseQueries interface {
	GetPasswordByEmail(email string) (datatypes.Password, error)
	CreateAccount(email, username, password string) (datatypes.Account, error)
	GetAccountById(id string) (datatypes.Account, error)
	IncrementFailedPasswordLoginAttempts(email string) error
	ResetFailedPasswordLoginAttempts(email string) error
	AddNewToken(accountId edgedb.UUID, value, variant string, expiresAt time.Time, scope []string) error
	AddNewTokenPair(accountId edgedb.UUID, accessTokenValue, refreshTokenValue string, accessTokenExpiresAt, refreshTokenExpiresAt time.Time, scope []string) error
	GetToken(tokenValue string) (datatypes.Token, error)
	ResetOTP(accountId edgedb.UUID) error
	SetOTPSecret(accountId edgedb.UUID, otpSecret string) error
	SetOTPState(accountId edgedb.UUID, otpState string) error
	CreateNewOAuthClientApplication(oauthClient datatypes.OAuthClient) error
	UpdateOAuth2ClientApplicationKeyValue(updateRequestData datatypes.UpdateOAuth2ClientKeyValueRequest) error
	DeleteOAuth2ClientApplication(clientId string) error
	GetOAuth2ClientApplication(clientID string) (datatypes.OAuthClient, error)
	CreateNewOAuth2AuthorizationCode(authorizationCode datatypes.OAuthAuthorizationCode) error
	GetOAuth2ClientApplicationAndUserAccount(clientID string, accountID edgedb.UUID) (datatypes.OAuthClient, datatypes.Account, error)
	GetOAuth2AuthorizationCode(code string) (datatypes.OAuthAuthorizationCode, error)
	DeleteOAuth2AuthorizationCode(code string) error
	GetRefreshToken(value string) (datatypes.Token, error)
	DeleteRefreshToken(id edgedb.UUID) error
	DeleteTokens(ids []edgedb.UUID) error
	DeleteTokensByValue(tokens []string) error
}

Jump to

Keyboard shortcuts

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