gormapplication

package
v0.0.0-...-2d73068 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 19 Imported by: 4

Documentation

Overview

Package gormapplication contains the code in charge of managing CRUD operations over all the defined objects in our gorm database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormBase

type GormBase struct {
	// contains filtered or unexported fields
}

GormBase is a base struct for gorm implementations of db & transaction

func (*GormBase) DB

func (g *GormBase) DB() *gorm.DB

func (*GormBase) DefaultRoleMappingRepository

func (g *GormBase) DefaultRoleMappingRepository() role.DefaultRoleMappingRepository

func (*GormBase) ExternalTokens

func (g *GormBase) ExternalTokens() token.ExternalTokenRepository

ExternalTokens returns an ExternalTokens repository

func (*GormBase) Identities

func (g *GormBase) Identities() account.IdentityRepository

Identities creates new Identity repository

func (*GormBase) IdentityRoleRepository

func (g *GormBase) IdentityRoleRepository() role.IdentityRoleRepository

func (*GormBase) InvitationRepository

func (g *GormBase) InvitationRepository() invitation.InvitationRepository

func (*GormBase) OauthStates

OauthStates returns an oauth state reference repository

func (*GormBase) PrivilegeCacheRepository

func (g *GormBase) PrivilegeCacheRepository() permission.PrivilegeCacheRepository

func (*GormBase) ResourceRepository

func (g *GormBase) ResourceRepository() resource.ResourceRepository

func (*GormBase) ResourceTypeRepository

func (g *GormBase) ResourceTypeRepository() resourcetype.ResourceTypeRepository

func (*GormBase) ResourceTypeScopeRepository

func (g *GormBase) ResourceTypeScopeRepository() resourcetype.ResourceTypeScopeRepository

func (*GormBase) RoleMappingRepository

func (g *GormBase) RoleMappingRepository() role.RoleMappingRepository

func (*GormBase) RoleRepository

func (g *GormBase) RoleRepository() role.RoleRepository

func (*GormBase) TokenRepository

func (g *GormBase) TokenRepository() token.TokenRepository

func (*GormBase) Users

func (g *GormBase) Users() account.UserRepository

Users creates new user repository

func (*GormBase) VerificationCodes

func (g *GormBase) VerificationCodes() account.VerificationCodeRepository

VerificationCodes returns an VerificationCodes repository

func (*GormBase) WorkerLockRepository

func (g *GormBase) WorkerLockRepository() worker.LockRepository

type GormDB

type GormDB struct {
	GormBase
	// contains filtered or unexported fields
}

GormDB implements the TransactionManager interface methods for initiating a new transaction

func NewGormDB

func NewGormDB(db *gorm.DB, config *configuration.ConfigurationData, wrappers factorymanager.FactoryWrappers, options ...factory.Option) *GormDB

func (*GormDB) AdminConsoleService

func (g *GormDB) AdminConsoleService() service.AdminConsoleService

func (*GormDB) AuthenticationProviderService

func (g *GormDB) AuthenticationProviderService() service.AuthenticationProviderService

func (*GormDB) BeginTransaction

func (g *GormDB) BeginTransaction() (transaction.Transaction, error)

BeginTransaction initiates a new transaction

func (*GormDB) CheService

func (g *GormDB) CheService() service.CheService

func (*GormDB) ClusterService

func (g *GormDB) ClusterService() service.ClusterService

func (*GormDB) InvitationService

func (g *GormDB) InvitationService() service.InvitationService

func (*GormDB) LinkService

func (g *GormDB) LinkService() service.LinkService

func (*GormDB) LogoutService

func (g *GormDB) LogoutService() service.LogoutService

func (*GormDB) NotificationService

func (g *GormDB) NotificationService() service.NotificationService

func (*GormDB) OSOSubscriptionService

func (g *GormDB) OSOSubscriptionService() service.OSOSubscriptionService

func (*GormDB) OrganizationService

func (g *GormDB) OrganizationService() service.OrganizationService

func (*GormDB) PermissionService

func (g *GormDB) PermissionService() service.PermissionService

func (*GormDB) PrivilegeCacheService

func (g *GormDB) PrivilegeCacheService() service.PrivilegeCacheService

func (*GormDB) ResourceService

func (g *GormDB) ResourceService() service.ResourceService

func (*GormDB) RoleManagementService

func (g *GormDB) RoleManagementService() service.RoleManagementService

func (*GormDB) SetTransactionIsolationLevel

func (g *GormDB) SetTransactionIsolationLevel(level TXIsoLevel) error

SetTransactionIsolationLevel sets the isolation level for See also https://www.postgresql.org/docs/9.3/static/sql-set-transaction.html

func (*GormDB) SpaceService

func (g *GormDB) SpaceService() service.SpaceService

func (*GormDB) TeamService

func (g *GormDB) TeamService() service.TeamService

func (*GormDB) TenantService

func (g *GormDB) TenantService() service.TenantService

func (*GormDB) TokenService

func (g *GormDB) TokenService() service.TokenService

func (*GormDB) UserProfileService

func (g *GormDB) UserProfileService() service.UserProfileService

func (*GormDB) UserService

func (g *GormDB) UserService() service.UserService

type GormTransaction

type GormTransaction struct {
	GormBase
}

GormTransaction implements the Transaction interface methods for committing or rolling back a transaction

func (*GormTransaction) Commit

func (g *GormTransaction) Commit() error

Commit commits the current transaction

func (*GormTransaction) Rollback

func (g *GormTransaction) Rollback() error

Rollback rolls back current transaction

type TXIsoLevel

type TXIsoLevel int8

A TXIsoLevel specifies the characteristics of the transaction See https://www.postgresql.org/docs/9.3/static/sql-set-transaction.html

const (
	// TXIsoLevelDefault doesn't specify any transaction isolation level, instead the connection
	// based setting will be used.
	TXIsoLevelDefault TXIsoLevel = iota

	// TXIsoLevelReadCommitted means "A statement can only see rows committed before it began. This is the default."
	TXIsoLevelReadCommitted

	// TXIsoLevelRepeatableRead means "All statements of the current transaction can only see rows committed before the
	// first query or data-modification statement was executed in this transaction."
	TXIsoLevelRepeatableRead

	// TXIsoLevelSerializable means "All statements of the current transaction can only see rows committed
	// before the first query or data-modification statement was executed in this transaction.
	// If a pattern of reads and writes among concurrent serializable transactions would create a
	// situation which could not have occurred for any serial (one-at-a-time) execution of those
	// transactions, one of them will be rolled back with a serialization_failure error."
	TXIsoLevelSerializable
)

Jump to

Keyboard shortcuts

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