consoledb

package
v1.116.2-rc Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is the default satellitedb errs class.
	Error = errs.Class("consoledb")
)

Functions

func ProjectFromDBX

func ProjectFromDBX(ctx context.Context, project *dbx.Project) (_ *console.Project, err error)

ProjectFromDBX is used for creating Project entity from autogenerated dbx.Project struct.

func UserFromDBX

func UserFromDBX(ctx context.Context, user *dbx.User) (_ *console.User, err error)

UserFromDBX is used for creating User entity from autogenerated dbx.User struct.

Types

type ConsoleDB

type ConsoleDB struct {
	*dbx.DB

	ApikeysLRUOptions lrucache.Options

	Impl dbutil.Implementation

	Methods dbx.DriverMethods

	ApikeysOnce *sync.Once
	// contains filtered or unexported fields
}

ConsoleDB contains access to different satellite databases.

func (*ConsoleDB) APIKeys

func (db *ConsoleDB) APIKeys() console.APIKeys

APIKeys is a getter for APIKeys repository.

func (*ConsoleDB) AccountFreezeEvents

func (db *ConsoleDB) AccountFreezeEvents() console.AccountFreezeEvents

AccountFreezeEvents is a getter for AccountFreezeEvents repository.

func (*ConsoleDB) ProjectInvitations

func (db *ConsoleDB) ProjectInvitations() console.ProjectInvitations

ProjectInvitations is a getter for ProjectInvitations repository.

func (*ConsoleDB) ProjectMembers

func (db *ConsoleDB) ProjectMembers() console.ProjectMembers

ProjectMembers is a getter for ProjectMembers repository.

func (*ConsoleDB) Projects

func (db *ConsoleDB) Projects() console.Projects

Projects is a getter for Projects repository.

func (*ConsoleDB) RegistrationTokens

func (db *ConsoleDB) RegistrationTokens() console.RegistrationTokens

RegistrationTokens is a getter for RegistrationTokens repository.

func (*ConsoleDB) ResetPasswordTokens

func (db *ConsoleDB) ResetPasswordTokens() console.ResetPasswordTokens

ResetPasswordTokens is a getter for ResetPasswordTokens repository.

func (*ConsoleDB) Users

func (db *ConsoleDB) Users() console.Users

Users is getter a for Users repository.

func (*ConsoleDB) WebappSessions

func (db *ConsoleDB) WebappSessions() consoleauth.WebappSessions

WebappSessions is a getter for WebappSessions repository.

func (*ConsoleDB) WithTx

func (db *ConsoleDB) WithTx(ctx context.Context, fn func(context.Context, console.DBTx) error) error

WithTx is a method for executing and retrying transaction.

type DBTx

type DBTx struct {
	*ConsoleDB
}

DBTx extends Database with transaction scope.

func (*DBTx) Commit

func (db *DBTx) Commit() error

Commit is a method for committing and closing transaction.

func (*DBTx) Rollback

func (db *DBTx) Rollback() error

Rollback is a method for rollback and closing transaction.

Jump to

Keyboard shortcuts

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