txsession

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 9 Imported by: 0

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