Documentation ¶
Overview ¶
Package postgres provides an interface for writing to a Postgres instance.
Index ¶
- Variables
- func ProvideDatabaseClient(ctx context.Context, logger logging.Logger, ...) (database.DataManager, error)
- type Querier
- func (q *Querier) AcceptAccountInvitation(ctx context.Context, accountInvitationID, token, note string) error
- func (q *Querier) AccountInvitationExists(ctx context.Context, accountInvitationID string) (bool, error)
- func (q *Querier) ArchiveAccount(ctx context.Context, accountID, userID string) error
- func (q *Querier) ArchiveOAuth2Client(ctx context.Context, clientID string) error
- func (q *Querier) ArchiveOAuth2ClientTokenByAccess(ctx context.Context, access string) error
- func (q *Querier) ArchiveOAuth2ClientTokenByCode(ctx context.Context, code string) error
- func (q *Querier) ArchiveOAuth2ClientTokenByRefresh(ctx context.Context, refresh string) error
- func (q *Querier) ArchiveServiceSetting(ctx context.Context, serviceSettingID string) error
- func (q *Querier) ArchiveServiceSettingConfiguration(ctx context.Context, serviceSettingConfigurationID string) error
- func (q *Querier) ArchiveUser(ctx context.Context, userID string) error
- func (q *Querier) ArchiveWebhook(ctx context.Context, webhookID, accountID string) error
- func (q *Querier) ArchiveWebhookTriggerEvent(ctx context.Context, webhookID, webhookTriggerEventID string) error
- func (q *Querier) BuildSessionContextDataForUser(ctx context.Context, userID string) (*types.SessionContextData, error)
- func (q *Querier) CancelAccountInvitation(ctx context.Context, accountInvitationID, note string) error
- func (q *Querier) Close()
- func (q *Querier) CreateAccount(ctx context.Context, input *types.AccountDatabaseCreationInput) (*types.Account, error)
- func (q *Querier) CreateAccountInvitation(ctx context.Context, input *types.AccountInvitationDatabaseCreationInput) (*types.AccountInvitation, error)
- func (q *Querier) CreateOAuth2Client(ctx context.Context, input *types.OAuth2ClientDatabaseCreationInput) (*types.OAuth2Client, error)
- func (q *Querier) CreateOAuth2ClientToken(ctx context.Context, input *types.OAuth2ClientTokenDatabaseCreationInput) (*types.OAuth2ClientToken, error)
- func (q *Querier) CreatePasswordResetToken(ctx context.Context, input *types.PasswordResetTokenDatabaseCreationInput) (*types.PasswordResetToken, error)
- func (q *Querier) CreateServiceSetting(ctx context.Context, input *types.ServiceSettingDatabaseCreationInput) (*types.ServiceSetting, error)
- func (q *Querier) CreateServiceSettingConfiguration(ctx context.Context, ...) (*types.ServiceSettingConfiguration, error)
- func (q *Querier) CreateUser(ctx context.Context, input *types.UserDatabaseCreationInput) (*types.User, error)
- func (q *Querier) CreateUserNotification(ctx context.Context, input *types.UserNotificationDatabaseCreationInput) (*types.UserNotification, error)
- func (q *Querier) CreateWebhook(ctx context.Context, input *types.WebhookDatabaseCreationInput) (*types.Webhook, error)
- func (q *Querier) DB() *sql.DB
- func (q *Querier) GetAccount(ctx context.Context, accountID string) (*types.Account, error)
- func (q *Querier) GetAccountInvitationByAccountAndID(ctx context.Context, accountID, accountInvitationID string) (*types.AccountInvitation, error)
- func (q *Querier) GetAccountInvitationByEmailAndToken(ctx context.Context, emailAddress, token string) (*types.AccountInvitation, error)
- func (q *Querier) GetAccountInvitationByTokenAndID(ctx context.Context, token, invitationID string) (*types.AccountInvitation, error)
- func (q *Querier) GetAccounts(ctx context.Context, userID string, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.Account], err error)
- func (q *Querier) GetAdminUserByUsername(ctx context.Context, username string) (*types.User, error)
- func (q *Querier) GetAuditLogEntriesForAccount(ctx context.Context, accountID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AuditLogEntry], error)
- func (q *Querier) GetAuditLogEntriesForAccountAndResourceType(ctx context.Context, accountID string, resourceTypes []string, ...) (*types.QueryFilteredResult[types.AuditLogEntry], error)
- func (q *Querier) GetAuditLogEntriesForUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AuditLogEntry], error)
- func (q *Querier) GetAuditLogEntriesForUserAndResourceType(ctx context.Context, userID string, resourceTypes []string, ...) (*types.QueryFilteredResult[types.AuditLogEntry], error)
- func (q *Querier) GetAuditLogEntry(ctx context.Context, auditLogEntryID string) (*types.AuditLogEntry, error)
- func (q *Querier) GetDefaultAccountIDForUser(ctx context.Context, userID string) (string, error)
- func (q *Querier) GetEmailAddressVerificationTokenForUser(ctx context.Context, userID string) (string, error)
- func (q *Querier) GetOAuth2ClientByClientID(ctx context.Context, clientID string) (*types.OAuth2Client, error)
- func (q *Querier) GetOAuth2ClientByDatabaseID(ctx context.Context, clientID string) (*types.OAuth2Client, error)
- func (q *Querier) GetOAuth2ClientTokenByAccess(ctx context.Context, access string) (*types.OAuth2ClientToken, error)
- func (q *Querier) GetOAuth2ClientTokenByCode(ctx context.Context, code string) (*types.OAuth2ClientToken, error)
- func (q *Querier) GetOAuth2ClientTokenByRefresh(ctx context.Context, refresh string) (*types.OAuth2ClientToken, error)
- func (q *Querier) GetOAuth2Clients(ctx context.Context, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.OAuth2Client], err error)
- func (q *Querier) GetPasswordResetTokenByToken(ctx context.Context, token string) (*types.PasswordResetToken, error)
- func (q *Querier) GetPendingAccountInvitationsForUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AccountInvitation], error)
- func (q *Querier) GetPendingAccountInvitationsFromUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AccountInvitation], error)
- func (q *Querier) GetServiceSetting(ctx context.Context, serviceSettingID string) (*types.ServiceSetting, error)
- func (q *Querier) GetServiceSettingConfiguration(ctx context.Context, serviceSettingConfigurationID string) (*types.ServiceSettingConfiguration, error)
- func (q *Querier) GetServiceSettingConfigurationForAccountByName(ctx context.Context, accountID, settingName string) (*types.ServiceSettingConfiguration, error)
- func (q *Querier) GetServiceSettingConfigurationForUserByName(ctx context.Context, userID, settingName string) (*types.ServiceSettingConfiguration, error)
- func (q *Querier) GetServiceSettingConfigurationsForAccount(ctx context.Context, accountID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.ServiceSettingConfiguration], error)
- func (q *Querier) GetServiceSettingConfigurationsForUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.ServiceSettingConfiguration], error)
- func (q *Querier) GetServiceSettings(ctx context.Context, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.ServiceSetting], err error)
- func (q *Querier) GetUser(ctx context.Context, userID string) (*types.User, error)
- func (q *Querier) GetUserByEmail(ctx context.Context, email string) (*types.User, error)
- func (q *Querier) GetUserByEmailAddressVerificationToken(ctx context.Context, token string) (*types.User, error)
- func (q *Querier) GetUserByUsername(ctx context.Context, username string) (*types.User, error)
- func (q *Querier) GetUserIDsThatNeedSearchIndexing(ctx context.Context) ([]string, error)
- func (q *Querier) GetUserNotification(ctx context.Context, userID, userNotificationID string) (*types.UserNotification, error)
- func (q *Querier) GetUserNotifications(ctx context.Context, userID string, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.UserNotification], err error)
- func (q *Querier) GetUserWithUnverifiedTwoFactorSecret(ctx context.Context, userID string) (*types.User, error)
- func (q *Querier) GetUsers(ctx context.Context, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.User], err error)
- func (q *Querier) GetWebhook(ctx context.Context, webhookID, accountID string) (*types.Webhook, error)
- func (q *Querier) GetWebhooks(ctx context.Context, accountID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.Webhook], error)
- func (q *Querier) GetWebhooksForAccountAndEvent(ctx context.Context, accountID string, eventType types.ServiceEventType) ([]*types.Webhook, error)
- func (q *Querier) IsReady(ctx context.Context, waitPeriod time.Duration, maxAttempts uint64) (ready bool)
- func (q *Querier) MarkAccountAsUserDefault(ctx context.Context, userID, accountID string) error
- func (q *Querier) MarkUserAsIndexed(ctx context.Context, userID string) error
- func (q *Querier) MarkUserEmailAddressAsUnverified(ctx context.Context, userID string) error
- func (q *Querier) MarkUserEmailAddressAsVerified(ctx context.Context, userID, token string) error
- func (q *Querier) MarkUserTwoFactorSecretAsUnverified(ctx context.Context, userID, newSecret string) error
- func (q *Querier) MarkUserTwoFactorSecretAsVerified(ctx context.Context, userID string) error
- func (q *Querier) Migrate(ctx context.Context, waitPeriod time.Duration, maxAttempts uint64) error
- func (q *Querier) ModifyUserPermissions(ctx context.Context, accountID, userID string, ...) error
- func (q *Querier) ProvideSessionStore() scs.Store
- func (q *Querier) RedeemPasswordResetToken(ctx context.Context, passwordResetTokenID string) error
- func (q *Querier) RejectAccountInvitation(ctx context.Context, accountInvitationID, note string) error
- func (q *Querier) RemoveUserFromAccount(ctx context.Context, userID, accountID string) error
- func (q *Querier) SearchForServiceSettings(ctx context.Context, query string) ([]*types.ServiceSetting, error)
- func (q *Querier) SearchForUsersByUsername(ctx context.Context, usernameQuery string) ([]*types.User, error)
- func (q *Querier) ServiceSettingConfigurationExists(ctx context.Context, serviceSettingConfigurationID string) (exists bool, err error)
- func (q *Querier) ServiceSettingExists(ctx context.Context, serviceSettingID string) (exists bool, err error)
- func (q *Querier) TransferAccountOwnership(ctx context.Context, accountID string, ...) error
- func (q *Querier) UpdateAccount(ctx context.Context, updated *types.Account) error
- func (q *Querier) UpdateServiceSettingConfiguration(ctx context.Context, updated *types.ServiceSettingConfiguration) error
- func (q *Querier) UpdateUserAccountStatus(ctx context.Context, userID string, input *types.UserAccountStatusUpdateInput) error
- func (q *Querier) UpdateUserAvatar(ctx context.Context, userID, newAvatarSrc string) error
- func (q *Querier) UpdateUserDetails(ctx context.Context, userID string, ...) error
- func (q *Querier) UpdateUserEmailAddress(ctx context.Context, userID, newEmailAddress string) error
- func (q *Querier) UpdateUserNotification(ctx context.Context, updated *types.UserNotification) error
- func (q *Querier) UpdateUserPassword(ctx context.Context, userID, newHash string) error
- func (q *Querier) UpdateUserTwoFactorSecret(ctx context.Context, userID, newSecret string) error
- func (q *Querier) UpdateUserUsername(ctx context.Context, userID, newUsername string) error
- func (q *Querier) UserIsMemberOfAccount(ctx context.Context, userID, accountID string) (bool, error)
- func (q *Querier) UserNotificationExists(ctx context.Context, userID, userNotificationID string) (exists bool, err error)
- func (q *Querier) WebhookExists(ctx context.Context, webhookID, accountID string) (exists bool, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNilInputProvided indicates nil input was provided in an unacceptable context. ErrNilInputProvided = errors.New("nil input provided") // ErrEmptyInputProvided indicates empty input was provided in an unacceptable context. ErrEmptyInputProvided = errors.New("empty input provided") // ErrInvalidIDProvided indicates a required ID was passed in as zero. ErrInvalidIDProvided = errors.New("required ID provided is zero") )
var ( // ProvidersPostgres are what we offer to dependency injection. ProvidersPostgres = wire.NewSet( ProvideDatabaseClient, ) )
Functions ¶
func ProvideDatabaseClient ¶
func ProvideDatabaseClient(ctx context.Context, logger logging.Logger, tracerProvider tracing.TracerProvider, cfg *dbconfig.Config) (database.DataManager, error)
ProvideDatabaseClient provides a new DataManager client.
Types ¶
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
Querier is the primary database querying client. All tracing/logging/query execution happens here. Query building generally happens elsewhere.
func (*Querier) AcceptAccountInvitation ¶
func (q *Querier) AcceptAccountInvitation(ctx context.Context, accountInvitationID, token, note string) error
AcceptAccountInvitation accepts a account invitation by its ID with a note.
func (*Querier) AccountInvitationExists ¶
func (q *Querier) AccountInvitationExists(ctx context.Context, accountInvitationID string) (bool, error)
AccountInvitationExists fetches whether a account invitation exists from the database.
func (*Querier) ArchiveAccount ¶
ArchiveAccount archives a account from the database by its ID.
func (*Querier) ArchiveOAuth2Client ¶
ArchiveOAuth2Client archives an OAuth2 client.
func (*Querier) ArchiveOAuth2ClientTokenByAccess ¶
ArchiveOAuth2ClientTokenByAccess archives an OAuth2 client token from the database by its ID.
func (*Querier) ArchiveOAuth2ClientTokenByCode ¶
ArchiveOAuth2ClientTokenByCode archives an OAuth2 client token from the database by its ID.
func (*Querier) ArchiveOAuth2ClientTokenByRefresh ¶
ArchiveOAuth2ClientTokenByRefresh archives an OAuth2 client token from the database by its ID.
func (*Querier) ArchiveServiceSetting ¶
ArchiveServiceSetting archives a service setting from the database by its ID.
func (*Querier) ArchiveServiceSettingConfiguration ¶
func (q *Querier) ArchiveServiceSettingConfiguration(ctx context.Context, serviceSettingConfigurationID string) error
ArchiveServiceSettingConfiguration archives a service setting configuration from the database by its ID.
func (*Querier) ArchiveUser ¶
ArchiveUser archives a user.
func (*Querier) ArchiveWebhook ¶
ArchiveWebhook archives a webhook from the database.
func (*Querier) ArchiveWebhookTriggerEvent ¶
func (q *Querier) ArchiveWebhookTriggerEvent(ctx context.Context, webhookID, webhookTriggerEventID string) error
ArchiveWebhookTriggerEvent archives a webhook trigger event from the database.
func (*Querier) BuildSessionContextDataForUser ¶
func (q *Querier) BuildSessionContextDataForUser(ctx context.Context, userID string) (*types.SessionContextData, error)
BuildSessionContextDataForUser queries the database for the memberships of a user and constructs a SessionContextData struct from the results.
func (*Querier) CancelAccountInvitation ¶
func (q *Querier) CancelAccountInvitation(ctx context.Context, accountInvitationID, note string) error
CancelAccountInvitation cancels a account invitation by its ID with a note.
func (*Querier) CreateAccount ¶
func (q *Querier) CreateAccount(ctx context.Context, input *types.AccountDatabaseCreationInput) (*types.Account, error)
CreateAccount creates a account in the database.
func (*Querier) CreateAccountInvitation ¶
func (q *Querier) CreateAccountInvitation(ctx context.Context, input *types.AccountInvitationDatabaseCreationInput) (*types.AccountInvitation, error)
CreateAccountInvitation creates an invitation in a database.
func (*Querier) CreateOAuth2Client ¶
func (q *Querier) CreateOAuth2Client(ctx context.Context, input *types.OAuth2ClientDatabaseCreationInput) (*types.OAuth2Client, error)
CreateOAuth2Client creates an OAuth2 client.
func (*Querier) CreateOAuth2ClientToken ¶
func (q *Querier) CreateOAuth2ClientToken(ctx context.Context, input *types.OAuth2ClientTokenDatabaseCreationInput) (*types.OAuth2ClientToken, error)
CreateOAuth2ClientToken creates an OAuth2 client token in the database.
func (*Querier) CreatePasswordResetToken ¶
func (q *Querier) CreatePasswordResetToken(ctx context.Context, input *types.PasswordResetTokenDatabaseCreationInput) (*types.PasswordResetToken, error)
CreatePasswordResetToken creates a password reset token in the database.
func (*Querier) CreateServiceSetting ¶
func (q *Querier) CreateServiceSetting(ctx context.Context, input *types.ServiceSettingDatabaseCreationInput) (*types.ServiceSetting, error)
CreateServiceSetting creates a service setting in the database.
func (*Querier) CreateServiceSettingConfiguration ¶
func (q *Querier) CreateServiceSettingConfiguration(ctx context.Context, input *types.ServiceSettingConfigurationDatabaseCreationInput) (*types.ServiceSettingConfiguration, error)
CreateServiceSettingConfiguration creates a service setting configuration in the database.
func (*Querier) CreateUser ¶
func (q *Querier) CreateUser(ctx context.Context, input *types.UserDatabaseCreationInput) (*types.User, error)
CreateUser creates a user. TODO: this should return a account as well.
func (*Querier) CreateUserNotification ¶
func (q *Querier) CreateUserNotification(ctx context.Context, input *types.UserNotificationDatabaseCreationInput) (*types.UserNotification, error)
CreateUserNotification creates a user notification in the database.
func (*Querier) CreateWebhook ¶
func (q *Querier) CreateWebhook(ctx context.Context, input *types.WebhookDatabaseCreationInput) (*types.Webhook, error)
CreateWebhook creates a webhook in a database.
func (*Querier) GetAccount ¶
GetAccount fetches a account from the database.
func (*Querier) GetAccountInvitationByAccountAndID ¶
func (q *Querier) GetAccountInvitationByAccountAndID(ctx context.Context, accountID, accountInvitationID string) (*types.AccountInvitation, error)
GetAccountInvitationByAccountAndID fetches an invitation from the database.
func (*Querier) GetAccountInvitationByEmailAndToken ¶
func (q *Querier) GetAccountInvitationByEmailAndToken(ctx context.Context, emailAddress, token string) (*types.AccountInvitation, error)
GetAccountInvitationByEmailAndToken fetches an invitation from the database.
func (*Querier) GetAccountInvitationByTokenAndID ¶
func (q *Querier) GetAccountInvitationByTokenAndID(ctx context.Context, token, invitationID string) (*types.AccountInvitation, error)
GetAccountInvitationByTokenAndID fetches an invitation from the database.
func (*Querier) GetAccounts ¶
func (q *Querier) GetAccounts(ctx context.Context, userID string, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.Account], err error)
GetAccounts fetches a list of accounts from the database that meet a particular filter.
func (*Querier) GetAdminUserByUsername ¶
GetAdminUserByUsername fetches a user by their username.
func (*Querier) GetAuditLogEntriesForAccount ¶
func (q *Querier) GetAuditLogEntriesForAccount(ctx context.Context, accountID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AuditLogEntry], error)
GetAuditLogEntriesForAccount fetches a list of audit log entries from the database that meet a particular filter.
func (*Querier) GetAuditLogEntriesForAccountAndResourceType ¶
func (q *Querier) GetAuditLogEntriesForAccountAndResourceType(ctx context.Context, accountID string, resourceTypes []string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AuditLogEntry], error)
GetAuditLogEntriesForAccountAndResourceType fetches a list of audit log entries from the database that meet a particular filter.
func (*Querier) GetAuditLogEntriesForUser ¶
func (q *Querier) GetAuditLogEntriesForUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AuditLogEntry], error)
GetAuditLogEntriesForUser fetches a list of audit log entries from the database that meet a particular filter.
func (*Querier) GetAuditLogEntriesForUserAndResourceType ¶
func (q *Querier) GetAuditLogEntriesForUserAndResourceType(ctx context.Context, userID string, resourceTypes []string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AuditLogEntry], error)
GetAuditLogEntriesForUserAndResourceType fetches a list of audit log entries from the database that meet a particular filter.
func (*Querier) GetAuditLogEntry ¶
func (q *Querier) GetAuditLogEntry(ctx context.Context, auditLogEntryID string) (*types.AuditLogEntry, error)
GetAuditLogEntry fetches an audit log entry from the database.
func (*Querier) GetDefaultAccountIDForUser ¶
GetDefaultAccountIDForUser retrieves the default account ID for a user.
func (*Querier) GetEmailAddressVerificationTokenForUser ¶
func (*Querier) GetOAuth2ClientByClientID ¶
func (q *Querier) GetOAuth2ClientByClientID(ctx context.Context, clientID string) (*types.OAuth2Client, error)
GetOAuth2ClientByClientID gets an OAuth2 client from the database.
func (*Querier) GetOAuth2ClientByDatabaseID ¶
func (q *Querier) GetOAuth2ClientByDatabaseID(ctx context.Context, clientID string) (*types.OAuth2Client, error)
GetOAuth2ClientByDatabaseID gets an OAuth2 client from the database.
func (*Querier) GetOAuth2ClientTokenByAccess ¶
func (q *Querier) GetOAuth2ClientTokenByAccess(ctx context.Context, access string) (*types.OAuth2ClientToken, error)
GetOAuth2ClientTokenByAccess fetches an OAuth2 client token from the database.
func (*Querier) GetOAuth2ClientTokenByCode ¶
func (q *Querier) GetOAuth2ClientTokenByCode(ctx context.Context, code string) (*types.OAuth2ClientToken, error)
GetOAuth2ClientTokenByCode fetches an OAuth2 client token from the database.
func (*Querier) GetOAuth2ClientTokenByRefresh ¶
func (q *Querier) GetOAuth2ClientTokenByRefresh(ctx context.Context, refresh string) (*types.OAuth2ClientToken, error)
GetOAuth2ClientTokenByRefresh fetches an OAuth2 client token from the database.
func (*Querier) GetOAuth2Clients ¶
func (q *Querier) GetOAuth2Clients(ctx context.Context, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.OAuth2Client], err error)
GetOAuth2Clients gets a list of OAuth2 clients.
func (*Querier) GetPasswordResetTokenByToken ¶
func (q *Querier) GetPasswordResetTokenByToken(ctx context.Context, token string) (*types.PasswordResetToken, error)
GetPasswordResetTokenByToken fetches a password reset token from the database by its token.
func (*Querier) GetPendingAccountInvitationsForUser ¶
func (q *Querier) GetPendingAccountInvitationsForUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AccountInvitation], error)
GetPendingAccountInvitationsForUser fetches pending account invitations sent to a given user.
func (*Querier) GetPendingAccountInvitationsFromUser ¶
func (q *Querier) GetPendingAccountInvitationsFromUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.AccountInvitation], error)
GetPendingAccountInvitationsFromUser fetches pending account invitations sent from a given user.
func (*Querier) GetServiceSetting ¶
func (q *Querier) GetServiceSetting(ctx context.Context, serviceSettingID string) (*types.ServiceSetting, error)
GetServiceSetting fetches a service setting from the database.
func (*Querier) GetServiceSettingConfiguration ¶
func (q *Querier) GetServiceSettingConfiguration(ctx context.Context, serviceSettingConfigurationID string) (*types.ServiceSettingConfiguration, error)
GetServiceSettingConfiguration fetches a service setting configuration from the database.
func (*Querier) GetServiceSettingConfigurationForAccountByName ¶
func (q *Querier) GetServiceSettingConfigurationForAccountByName(ctx context.Context, accountID, settingName string) (*types.ServiceSettingConfiguration, error)
GetServiceSettingConfigurationForAccountByName fetches a service setting configuration from the database.
func (*Querier) GetServiceSettingConfigurationForUserByName ¶
func (q *Querier) GetServiceSettingConfigurationForUserByName(ctx context.Context, userID, settingName string) (*types.ServiceSettingConfiguration, error)
GetServiceSettingConfigurationForUserByName fetches a service setting configuration from the database.
func (*Querier) GetServiceSettingConfigurationsForAccount ¶
func (q *Querier) GetServiceSettingConfigurationsForAccount(ctx context.Context, accountID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.ServiceSettingConfiguration], error)
GetServiceSettingConfigurationsForAccount fetches a list of service setting configurations from the database that meet a particular filter.
func (*Querier) GetServiceSettingConfigurationsForUser ¶
func (q *Querier) GetServiceSettingConfigurationsForUser(ctx context.Context, userID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.ServiceSettingConfiguration], error)
GetServiceSettingConfigurationsForUser fetches a list of service setting configurations from the database that meet a particular filter.
func (*Querier) GetServiceSettings ¶
func (q *Querier) GetServiceSettings(ctx context.Context, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.ServiceSetting], err error)
GetServiceSettings fetches a list of service settings from the database that meet a particular filter.
func (*Querier) GetUserByEmail ¶
GetUserByEmail fetches a user by their email.
func (*Querier) GetUserByEmailAddressVerificationToken ¶
func (*Querier) GetUserByUsername ¶
GetUserByUsername fetches a user by their username.
func (*Querier) GetUserIDsThatNeedSearchIndexing ¶
GetUserIDsThatNeedSearchIndexing fetches a list of valid vessels from the database that meet a particular filter.
func (*Querier) GetUserNotification ¶
func (q *Querier) GetUserNotification(ctx context.Context, userID, userNotificationID string) (*types.UserNotification, error)
GetUserNotification fetches a user notification from the database.
func (*Querier) GetUserNotifications ¶
func (q *Querier) GetUserNotifications(ctx context.Context, userID string, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.UserNotification], err error)
GetUserNotifications fetches a list of user notifications from the database that meet a particular filter.
func (*Querier) GetUserWithUnverifiedTwoFactorSecret ¶
func (q *Querier) GetUserWithUnverifiedTwoFactorSecret(ctx context.Context, userID string) (*types.User, error)
GetUserWithUnverifiedTwoFactorSecret fetches a user with an unverified 2FA secret.
func (*Querier) GetUsers ¶
func (q *Querier) GetUsers(ctx context.Context, filter *types.QueryFilter) (x *types.QueryFilteredResult[types.User], err error)
GetUsers fetches a list of users from the database that meet a particular filter.
func (*Querier) GetWebhook ¶
func (q *Querier) GetWebhook(ctx context.Context, webhookID, accountID string) (*types.Webhook, error)
GetWebhook fetches a webhook from the database.
func (*Querier) GetWebhooks ¶
func (q *Querier) GetWebhooks(ctx context.Context, accountID string, filter *types.QueryFilter) (*types.QueryFilteredResult[types.Webhook], error)
GetWebhooks fetches a list of webhooks from the database that meet a particular filter.
func (*Querier) GetWebhooksForAccountAndEvent ¶
func (q *Querier) GetWebhooksForAccountAndEvent(ctx context.Context, accountID string, eventType types.ServiceEventType) ([]*types.Webhook, error)
GetWebhooksForAccountAndEvent fetches a list of webhooks from the database that meet a particular filter.
func (*Querier) IsReady ¶
func (q *Querier) IsReady(ctx context.Context, waitPeriod time.Duration, maxAttempts uint64) (ready bool)
IsReady is a simple wrapper around the core querier IsReady call.
func (*Querier) MarkAccountAsUserDefault ¶
MarkAccountAsUserDefault does a thing.
func (*Querier) MarkUserAsIndexed ¶
MarkUserAsIndexed updates a particular user's last_indexed_at value.
func (*Querier) MarkUserEmailAddressAsUnverified ¶
func (*Querier) MarkUserEmailAddressAsVerified ¶
func (*Querier) MarkUserTwoFactorSecretAsUnverified ¶
func (q *Querier) MarkUserTwoFactorSecretAsUnverified(ctx context.Context, userID, newSecret string) error
MarkUserTwoFactorSecretAsUnverified marks a user's two factor secret as unverified.
func (*Querier) MarkUserTwoFactorSecretAsVerified ¶
MarkUserTwoFactorSecretAsVerified marks a user's two factor secret as validated.
func (*Querier) ModifyUserPermissions ¶
func (q *Querier) ModifyUserPermissions(ctx context.Context, accountID, userID string, input *types.ModifyUserPermissionsInput) error
ModifyUserPermissions does a thing.
func (*Querier) ProvideSessionStore ¶
func (q *Querier) ProvideSessionStore() scs.Store
ProvideSessionStore provides the scs Store for Postgres.
func (*Querier) RedeemPasswordResetToken ¶
RedeemPasswordResetToken redeems a password reset token from the database by its ID.
func (*Querier) RejectAccountInvitation ¶
func (q *Querier) RejectAccountInvitation(ctx context.Context, accountInvitationID, note string) error
RejectAccountInvitation rejects a account invitation by its ID with a note.
func (*Querier) RemoveUserFromAccount ¶
RemoveUserFromAccount removes a user's membership to a account.
func (*Querier) SearchForServiceSettings ¶
func (q *Querier) SearchForServiceSettings(ctx context.Context, query string) ([]*types.ServiceSetting, error)
SearchForServiceSettings fetches a service setting from the database.
func (*Querier) SearchForUsersByUsername ¶
func (q *Querier) SearchForUsersByUsername(ctx context.Context, usernameQuery string) ([]*types.User, error)
SearchForUsersByUsername fetches a list of users whose usernames begin with a given query.
func (*Querier) ServiceSettingConfigurationExists ¶
func (q *Querier) ServiceSettingConfigurationExists(ctx context.Context, serviceSettingConfigurationID string) (exists bool, err error)
ServiceSettingConfigurationExists fetches whether a service setting configuration exists from the database.
func (*Querier) ServiceSettingExists ¶
func (q *Querier) ServiceSettingExists(ctx context.Context, serviceSettingID string) (exists bool, err error)
ServiceSettingExists fetches whether a service setting exists from the database.
func (*Querier) TransferAccountOwnership ¶
func (q *Querier) TransferAccountOwnership(ctx context.Context, accountID string, input *types.AccountOwnershipTransferInput) error
TransferAccountOwnership does a thing.
func (*Querier) UpdateAccount ¶
UpdateAccount updates a particular account. Note that UpdateAccount expects the provided input to have a valid ID.
func (*Querier) UpdateServiceSettingConfiguration ¶
func (q *Querier) UpdateServiceSettingConfiguration(ctx context.Context, updated *types.ServiceSettingConfiguration) error
UpdateServiceSettingConfiguration updates a particular service setting configuration.
func (*Querier) UpdateUserAccountStatus ¶
func (q *Querier) UpdateUserAccountStatus(ctx context.Context, userID string, input *types.UserAccountStatusUpdateInput) error
UpdateUserAccountStatus updates a user's account status.
func (*Querier) UpdateUserAvatar ¶
UpdateUserAvatar updates a user's avatar source.
func (*Querier) UpdateUserDetails ¶
func (q *Querier) UpdateUserDetails(ctx context.Context, userID string, input *types.UserDetailsDatabaseUpdateInput) error
UpdateUserDetails updates a user's username.
func (*Querier) UpdateUserEmailAddress ¶
UpdateUserEmailAddress updates a user's username.
func (*Querier) UpdateUserNotification ¶
func (q *Querier) UpdateUserNotification(ctx context.Context, updated *types.UserNotification) error
UpdateUserNotification updates a particular user notification.
func (*Querier) UpdateUserPassword ¶
UpdateUserPassword updates a user's passwords hash in the database.
func (*Querier) UpdateUserTwoFactorSecret ¶
UpdateUserTwoFactorSecret marks a user's two factor secret as validated.
func (*Querier) UpdateUserUsername ¶
UpdateUserUsername updates a user's username.
func (*Querier) UserIsMemberOfAccount ¶
func (q *Querier) UserIsMemberOfAccount(ctx context.Context, userID, accountID string) (bool, error)
UserIsMemberOfAccount does a thing.
Source Files ¶
- account_invitations.go
- account_user_memberships.go
- accounts.go
- admin.go
- audit_log_entries.go
- doc.go
- errors.go
- migrate.go
- oauth2_client_tokens.go
- oauth2_clients.go
- password_reset_tokens.go
- postgres.go
- query_filters.go
- service_setting_configurations.go
- service_settings.go
- user_notifications.go
- users.go
- webhooks.go
- wire.go