noop

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package noop provides a no-op DTM distributed transaction client for monolith scenarios. This client returns ErrNoopDTM for all transaction operations. Note: Distributed transactions are not available in monolith mode.

空 DTM 分布式事务客户端实现包,用于单体应用场景。 此客户端对所有事务操作返回 ErrNoopDTM 错误。 注意:分布式事务在单体模式下不可用。

Index

Constants

This section is empty.

Variables

View Source
var ErrNoopDTM = errors.New("dtm: noop mode, distributed transaction not available in monolith")

ErrNoopDTM indicates DTM is not available in monolith mode.

ErrNoopDTM 表示 DTM 在单体模式下不可用。

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider registers a no-op DTM client contract.

Provider 注册空 DTM 客户端契约。

func NewProvider

func NewProvider() *Provider

NewProvider creates a new no-op DTM provider instance.

NewProvider 创建新的空 DTM Provider 实例。

func (*Provider) Boot

Boot is a no-op for this provider.

Boot 此 Provider 无启动逻辑。

func (*Provider) DependsOn

func (p *Provider) DependsOn() []string

DependsOn returns the keys this provider depends on. Noop DTM has no dependencies.

DependsOn 返回该 provider 依赖的 key。 Noop DTM 无依赖。

func (*Provider) IsDefer

func (p *Provider) IsDefer() bool

IsDefer returns true, DTM client can be deferred until first use.

IsDefer 返回 true,DTM 客户端可延迟初始化直到首次使用。

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name "dtm.noop".

Name 返回 Provider 名称 "dtm.noop"。

func (*Provider) Provides

func (p *Provider) Provides() []string

Provides returns the DTM client contract key.

Provides 返回 DTM 客户端契约键。

func (*Provider) Register

func (p *Provider) Register(c runtimecontract.Container) error

Register binds the no-op DTM client to the container.

Register 将空 DTM 客户端绑定到容器。

Jump to

Keyboard shortcuts

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