dbsession

package
v0.0.0-...-980806f Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueViolationErrorCode = "23505"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	NewReadSession() ReadSession
	NewWriteSession() WriteSession
	NewSessionWithinTransaction() (WriteSessionWithinTransaction, dberr.Error)
}

func NewFactory

func NewFactory(connection *dbr.Connection) Factory

type ReadSession

type ReadSession interface {
	FindAllInstancesJoinedWithOperation(prct ...predicate.Predicate) ([]internal.InstanceWithOperation, dberr.Error)
	FindAllInstancesForRuntimes(runtimeIdList []string) ([]internal.Instance, dberr.Error)
	GetInstanceByID(instanceID string) (internal.Instance, dberr.Error)
	GetOperationByID(opID string) (dbmodel.OperationDTO, dberr.Error)
	GetOperationsInProgressByType(operationType dbmodel.OperationType) ([]dbmodel.OperationDTO, dberr.Error)
	GetOperationByTypeAndInstanceID(inID string, opType dbmodel.OperationType) (dbmodel.OperationDTO, dberr.Error)
	GetLMSTenant(name, region string) (dbmodel.LMSTenantDTO, dberr.Error)
	GetOperationStats() ([]dbmodel.OperationStatEntry, error)
	GetInstanceStats() ([]dbmodel.InstanceByGlobalAccountIDStatEntry, error)
}

type Transaction

type Transaction interface {
	Commit() dberr.Error
	RollbackUnlessCommitted()
}

type WriteSession

type WriteSession interface {
	InsertInstance(instance internal.Instance) dberr.Error
	InsertOperation(dto dbmodel.OperationDTO) dberr.Error
	UpdateInstance(instance internal.Instance) dberr.Error
	UpdateOperation(instance dbmodel.OperationDTO) dberr.Error
	InsertLMSTenant(dto dbmodel.LMSTenantDTO) dberr.Error
	DeleteInstance(instanceID string) dberr.Error
}

type WriteSessionWithinTransaction

type WriteSessionWithinTransaction interface {
	WriteSession
	Transaction
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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