txsession

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutorFactory

type ExecutorFactory func(dbName string) (*cypher.StorageExecutor, error)

ExecutorFactory creates a fresh executor scoped to a database. Each explicit transaction gets its own executor instance.

type Manager

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

Manager tracks explicit transaction sessions and lifecycle operations.

func NewManager

func NewManager(ttl time.Duration, factory ExecutorFactory) *Manager

func (*Manager) CommitAndDelete

func (m *Manager) CommitAndDelete(ctx context.Context, session *Session) (*cypher.ExecuteResult, error)

func (*Manager) Delete

func (m *Manager) Delete(txID string)

func (*Manager) ExecuteInSession

func (m *Manager) ExecuteInSession(ctx context.Context, session *Session, query string, params map[string]interface{}) (*cypher.ExecuteResult, error)

func (*Manager) Get

func (m *Manager) Get(txID string) (*Session, bool)

func (*Manager) GetForOwner

func (m *Manager) GetForOwner(txID string, owner string) (*Session, bool)

func (*Manager) Open

func (m *Manager) Open(ctx context.Context, dbName string) (*Session, error)

func (*Manager) OpenForOwner

func (m *Manager) OpenForOwner(ctx context.Context, dbName string, owner string) (*Session, error)

func (*Manager) OpenWithExecutor

func (m *Manager) OpenWithExecutor(ctx context.Context, dbName string, executor *cypher.StorageExecutor) (*Session, error)

OpenWithExecutor opens a transaction session using a pre-built executor. This is used when executor construction depends on request context (for example forwarding auth to remote composite constituents).

func (*Manager) OpenWithExecutorForOwner

func (m *Manager) OpenWithExecutorForOwner(ctx context.Context, dbName string, executor *cypher.StorageExecutor, owner string) (*Session, error)

func (*Manager) RollbackAndDelete

func (m *Manager) RollbackAndDelete(ctx context.Context, session *Session) error

func (*Manager) SetTerminalErrorObserver

func (m *Manager) SetTerminalErrorObserver(observer func(*Session, error))

func (*Manager) Touch

func (m *Manager) Touch(session *Session)

type Session

type Session struct {
	ID       string
	Database string
	Owner    string
	Executor *cypher.StorageExecutor
	Expires  time.Time
	// contains filtered or unexported fields
}

Session stores explicit transaction state shared across transports.

Jump to

Keyboard shortcuts

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