dcp

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 28 Imported by: 8 modules, 7 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.

README

Go Dcp Go Reference OpenSSF Scorecard

This repository contains a Go implementation of a Couchbase Database Change Protocol (DCP) client. You can find a chapter-by-chapter architecture guide in our docs.

Contents
Why?
Example
package main

import (
  "github.com/Trendyol/go-dcp"
  "github.com/Trendyol/go-dcp/logger"
  "github.com/Trendyol/go-dcp/models"
)

func listener(ctx *models.ListenerContext) {
  switch event := ctx.Event.(type) {
  case models.DcpMutation:
    logger.Log.Info(
      "document mutated",
      "vbID", event.VbID,
      "eventTime", event.EventTime,
      "id", string(event.Key),
      "value", string(event.Value),
      "created", event.IsCreated(),
    )
  case models.DcpDeletion:
    logger.Log.Info(
      "document deleted",
      "vbID", event.VbID,
      "eventTime", event.EventTime,
      "id", string(event.Key),
    )
  case models.DcpExpiration:
    logger.Log.Info(
      "document expired",
      "vbID", event.VbID,
      "eventTime", event.EventTime,
      "id", string(event.Key),
    )
  }

  ctx.Ack()
}

func main() {
  connector, err := dcp.NewDcp("config.yml", listener)
  if err != nil {
    panic(err)
  }

  defer connector.Close()

  connector.Start()
}
Usage
go get github.com/Trendyol/go-dcp

You can construct a client with:

  • dcp.NewDcp(cfg, listener) — accepts a YAML file path (string), *config.Dcp, or config.Dcp with a models.Listener callback.
  • dcp.NewDcpWithLogger(cfg, listener, slogLogger) — installs a custom standard library *slog.Logger (also bridging gocbcore logs) before creating the client.
  • dcp.NewExtendedDcp(cfg, consumer) — uses a full models.Consumer (ConsumeEvent + TrackOffset).
  • dcp.NewTypedDcp(cfg, typedConsumer) — zero-allocation fast path accepting models.TypedConsumer (OnMutation, OnDeletion, OnExpiration with value-embedded events, zero-alloc ForEachXattr, and optional models.AcknowledgerAware / models.OffsetTracker for deferred AckToken acks).
  • dcp.NewTypedDcpWithLogger(cfg, typedConsumer, slogLogger) — combines NewTypedDcp with a custom standard library *slog.Logger.
Zero-Allocation TypedConsumer Example
type myConsumer struct{}

func (myConsumer) OnMutation(ev *models.MutationEvent) bool {
  // Borrowed slices (ev.Key, ev.Value, ForEachXattr) are valid until OnMutation returns.
  return true // return true for synchronous 0-alloc ack, or capture ev.AckToken() and return false
}
func (myConsumer) OnDeletion(ev *models.DeletionEvent) bool     { return true }
func (myConsumer) OnExpiration(ev *models.ExpirationEvent) bool { return true }

connector, err := dcp.NewTypedDcpWithLogger("config.yml", myConsumer{}, slog.Default())

See examples/typed/main.go for a complete runnable example.

Configuration
Variable Type Required Default Description
hosts []string yes - Couchbase hosts, e.g. localhost:8091.
username string yes - Couchbase username.
password string yes - Couchbase password.
bucketName string yes - Couchbase DCP bucket.
dcp.group.name string yes - DCP consumer group name used for membership coordination and checkpoint keys.
scopeName string no _default Couchbase scope name, or * to stream all scopes and collections in the bucket dynamically.
collectionNames []string no _default Couchbase collection names, or ["*"] to stream all existing and future collections inside scopeName dynamically.
connectionBufferSize uint, string no 20mb Source bucket TCP connection buffer size (x Node Count). Check this if you get OOM killed.
maxQueueSize int no 2048 Maximum number of KV requests that can be queued waiting to be sent to a node. Check this if you get queue overflowed or queue full.
connectionTimeout time.Duration no 1m Couchbase connection timeout.
maxIdemponentCallAttempts int no 1 Maximum attempts for idempotent Couchbase management HTTP calls (values <= 0 default to 1).
secureConnection bool no false Enable TLS connection to Couchbase.
rootCAPath string no *not set Path to root CA PEM file. Required when secureConnection is true.
debug bool no false Enables debug API endpoints (/states/offset, /states/followers, /debug/pprof/*).
dcp.bufferSize uint, string no 16mb DCP internal queue buffer size (x Node Count). Accepts integer bytes or size strings like 16mb. Check this if you get OOM killed.
dcp.prefetch.enabled bool no false Enables a byte-bounded sliding prefetch buffer between gocbcore and your consumer so Couchbase can stream the next window while your consumer processes the current one.
dcp.prefetch.bufferSize uint, string no dcp.bufferSize Total byte capacity shared across the prefetch buffer (not multiplied by data node count) when dcp.prefetch.enabled is true. Applies backpressure to DCP once full.
dcp.prefetch.workers int no 1 Number of per-vBucket sharded worker goroutines (vbID % workers, 1..1024, capped at assigned vBucket count) when dcp.prefetch.enabled is true. Preserves strict per-vBucket event ordering.
dcp.mode string no infinite Set finite to stream existing events up to the current high sequence numbers (or dcp.endTime) and exit automatically; set infinite to stream continuously.
dcp.endTime time.Time no *not set Optional point-in-time upper bound for dcp.mode: finite (RFC3339). Drops events strictly after endTime; historical endTime stops each vBucket early once crossed, while a future endTime streams live until the deadline elapses.
dcp.connectionBufferSize uint, string no 20mb DCP TCP connection buffer size (x Node Count). Check this if you get OOM killed.
dcp.connectionTimeout time.Duration no 1m DCP connection timeout.
dcp.maxQueueSize int no 2048 Maximum number of DCP requests that can be queued waiting to be sent to a node.
dcp.listener.skipUntil time.Time no *not set Skip events whose timestamp is earlier than this time.
dcp.group.membership.type string no couchbase DCP membership type: couchbase, kubernetesHa, kubernetesStatefulSet, static, or dynamic.
dcp.group.membership.assignmentStrategy string no consistent vBucket partitioning strategy: consistent (identity-based Rendezvous/HRW hashing on couchbase & kubernetesHa with 0% survivor churn on any pod crash/rollover; Jump Consistent Hash on static/kubernetesStatefulSet/dynamic) or range (contiguous chunks). Combined with incremental diff-based rebalancing and a two-phase peer release barrier (rebalanceDelay acts as the safety ceiling). Mixed-version couchbase/kubernetesHa rolling upgrades automatically negotiate range until all live pods support consistent.
dcp.group.membership.memberNumber int no 1 1-based member index (1 <= memberNumber <= totalMembers). Used when membership is static.
dcp.group.membership.totalMembers int no 1 Total members (1..4096). Used when membership is static or kubernetesStatefulSet.
dcp.group.membership.rebalanceDelay time.Duration no 5s Delay before applying a detected rebalance. Ignored (forced to 0s) when membership is dynamic.
dcp.group.membership.config map[string]string no *not set Key-values for couchbase membership: expirySeconds (120), heartbeatInterval (5s), heartbeatToleranceDuration (15s), monitorInterval (10s), watchInterval (1s), timeout (10s).
dcp.config.disableChangeStreams bool no false Set true to disable change history streams on Couchbase Server 7.2.0+ Magma buckets.
dcp.config.includeXattrs bool no false Set true to include Couchbase Extended Attributes (XATTRs) on DcpMutation and DcpDeletion events (event.Xattrs). XATTR framing is automatically stripped so event.Value always holds only the clean document body.
dcp.config.noValue bool no false Set true to open DCP streams with memd.DcpOpenFlagNoValue (key-only mode), omitting document bodies on the wire for cache invalidation or key-index connectors.
dcp.config.disableCompression bool no false Set true to disable Snappy wire compression on the DCP connection (enabled by default). Both compressed and uncompressed packets are decoded cleanly across XATTR and non-XATTR modes.
dcp.config.enableOSOBackfill bool no false Set true to negotiate Out-of-Sequence-Order (OSO) backfills (enable_out_of_order_snapshots=true_with_seqno_advanced) on Couchbase Server 7.1.0+ persistent buckets. Speeds up initial backfills of small collections; items arrive out of seqNo order and checkpoints only advance once each OSO snapshot completes.
dcp.config.priority string no low DCP stream priority requested from Couchbase: low, medium, or high. Maps to gocbcore DcpAgentPriority (set_priority DCP control).
leaderElection.enabled bool no false Set true for kubernetesHa membership.
leaderElection.type string no kubernetes Leader election implementation (kubernetes).
leaderElection.config map[string]string no *not set Key-values for kubernetes leader election: leaseLockName (required), leaseLockNamespace (required), leaseDuration (8s), renewDeadline (5s), retryPeriod (1s). Requires leaseDuration > renewDeadline > retryPeriod.
leaderElection.rpc.port int no 8081 gRPC bi-directional stream port used by leader/follower service discovery in kubernetesHa membership.
leaderElection.rpc.tls.enabled bool no false Enable TLS on the leader/follower gRPC bi-directional stream.
leaderElection.rpc.tls.certPath string no *not set PEM certificate path for the gRPC server (and for client authentication in mTLS when set). Required when leaderElection.rpc.tls.enabled is true.
leaderElection.rpc.tls.keyPath string no *not set PEM private key path matching certPath. Required when leaderElection.rpc.tls.enabled is true.
leaderElection.rpc.tls.caPath string no *not set Optional CA PEM bundle path for verifying the leader certificate on clients and follower client certificates when clientAuth is true.
leaderElection.rpc.tls.serverName string no *not set Optional TLS server name override (SNI / SAN verification when dialing pods by IP).
leaderElection.rpc.tls.clientAuth bool no false Require and verify client certificates (mutual TLS / mTLS) on the gRPC server.
leaderElection.rpc.tls.insecureSkipVerify bool no false Skip server certificate verification on the gRPC client (development/testing only).
checkpoint.type string no auto Checkpoint commit mode: auto (periodic background saves) or manual (via ctx.Commit() / connector.Commit()).
checkpoint.autoReset string no earliest Starting position when no checkpoint exists for a vBucket: earliest (seqNo 0), latest (current high seqNo), timestamp (seeks past events before checkpoint.startTime while advancing checkpoints), or offsets (seeds from checkpoint.initialOffsets).
checkpoint.startTime time.Time no *not set Required when checkpoint.autoReset is timestamp (RFC3339). Events earlier than startTime are skipped while advancing vBucket checkpoints so restarts do not rescan skipped history.
checkpoint.initialOffsets map[uint16]CheckpointOffset no *not set Required when checkpoint.autoReset is offsets. Per-vBucket starting coordinates (seqNo, optional vbUUID, startSeqNo, endSeqNo); omitted vbUUID is resolved from Couchbase failover logs automatically.
checkpoint.interval time.Duration no 1m Auto-checkpoint flush interval.
checkpoint.timeout time.Duration no 1m Timeout for loading, saving, and clearing checkpoints in Couchbase metadata.
checkpoint.rollbackToZeroWhenCorrupted bool no false When true, if any assigned vBucket checkpoint is corrupted (unparseable JSON, missing fields, BucketUUID mismatch, invalid snapshot range, seqNo > 0 with vbUUID == 0, or seqNo > latestSeqNo), rolls all assigned vBuckets back to seqNo 0 and persists clean zero checkpoints.
healthCheck.disabled bool no false Disable periodic Couchbase connection health checks and the GET /status API endpoint.
healthCheck.interval time.Duration no 1m Periodic Couchbase connection health check interval.
healthCheck.timeout time.Duration no 1m Couchbase connection health check timeout.
rollbackMitigation.disabled bool no false Disable proactive persisted-seqNo rollback mitigation. Automatically disabled at runtime for ephemeral buckets.
rollbackMitigation.interval time.Duration no 1s Persisted sequence number (ObserveVb) polling interval.
rollbackMitigation.configWatchInterval time.Duration no 10s Cluster topology config watch interval for rollback mitigation.
metadata.type string no couchbase Metadata storage backend: couchbase, file, or noop. Couchbase metadata bounds concurrent KV ops and materializes only dirty vBuckets during saves.
metadata.readOnly bool no false Wraps metadata in a read-only adapter so checkpoints are loaded but never written (useful for debugging).
metadata.config map[string]string no *not set For couchbase: hosts, username, password, bucket, scope, collection, maxQueueSize (2048), maxConcurrency (64), connectionBufferSize (5mb x Node Count), connectionTimeout (1m), secureConnection, rootCAPath. For file: fileName.
api.disabled bool no false Disable the HTTP API server (metrics, health, rebalance, membership, and debug endpoints).
api.port int no 8080 HTTP API listen port (0..65535). Multiple go-dcp instances in the same process configured with the same port share a single HTTP server and /metrics endpoint.
metric.path string no /metrics Prometheus metrics endpoint path.
metric.labels map[string]string no *not set Optional custom Prometheus constant labels attached to every metric of this instance (valid Prometheus label names, not starting with __). Merged with default bucket and group labels.
logging.level string no info Logging level (trace, debug, info, warn, error) using standard library log/slog JSON output. Ignored if a custom *slog.Logger is installed via NewDcpWithLogger, NewTypedDcpWithLogger, or logger.Set.
Environment Variables
  1. Direct membership overrides (always overwrite the corresponding config fields):
Variable Type Corresponding Config Description
GO_DCP__DCP_GROUP_MEMBERSHIP_MEMBERNUMBER int dcp.group.membership.memberNumber Overrides member number without editing config files or redeploying.
GO_DCP__DCP_GROUP_MEMBERSHIP_TOTALMEMBERS int dcp.group.membership.totalMembers Overrides total member count without editing config files or redeploying.
  1. YAML placeholder expansion: When loading configuration from a YAML file path, scalar values containing ${ENV_VAR} are expanded from environment variables before decoding.
  2. Kubernetes pod identity: POD_NAME (used by kubernetesStatefulSet and kubernetesHa) and POD_NAMESPACE (used by kubernetesHa) are read when present, falling back to hostname / in-cluster service account namespace.
Monitoring

The client exposes an HTTP API (enabled by default on :8080) with operational endpoints and Prometheus metrics.

API
Endpoint Description Debug Mode Condition / Body
GET /status Pings Couchbase and (in infinite mode, when open) verifies active DCP streams match assigned vBuckets; returns 200 OK (OK) when healthy or 503 Service Unavailable when ping fails or streams are inactive. Registered when healthCheck.disabled is false
GET /rebalance Triggers a vBucket rebalance operation on the active stream.
GET /states/offset Returns the current in-memory offsets for each assigned vBucket. x
GET /states/followers Returns the list of follower clients when leader-election service discovery (kubernetesHa) is enabled. x
GET /debug/pprof/* Fiber Pprof profiling endpoints. x
PUT /membership/info Updates memberNumber/totalMembers (1 <= memberNumber <= totalMembers <= 4096) and triggers rebalance if changed. Registered when dcp.group.membership.type is dynamic; body: {"memberNumber": 1, "totalMembers": 3}

Prometheus metrics are exposed at metric.path (default /metrics). When multiple go-dcp instances run in the same Go process on the same api.port, they share a single HTTP server and /metrics endpoint (the server stays running until the last instance shuts down). Each instance's cbgo_* and custom SetMetricCollectors metrics are automatically tagged with bucket (bucketName), group (dcp.group.name), and any custom metric.labels so instances remain cleanly separated in Prometheus (with automatic dcp_instance disambiguation if two instances share identical labels). Multi-instance operational endpoints (/status, /rebalance, /states/offset, /states/followers, /membership/info) also support optional ?group= and ?bucket= query filters.

Exposed Metrics

Every metric below (as well as custom collectors passed via SetMetricCollectors) automatically carries bucket and group labels when configured, plus any custom metric.labels.

Metric Name Description Labels Value Type
cbgo_mutation_total Total number of mutations on a specific vBucket vbId: vBucket ID Counter
cbgo_deletion_total Total number of deletions on a specific vBucket vbId: vBucket ID Counter
cbgo_expiration_total Total number of expirations on a specific vBucket vbId: vBucket ID Counter
cbgo_agent_queue_current Current number of queued items in an agent pipeline address: node address, is_dcp: true/false Gauge
cbgo_agent_queue_max Maximum queue capacity of an agent pipeline address: node address, is_dcp: true/false Gauge
cbgo_stream_rollback_total Total DCP stream rollbacks encountered on OpenStream N/A Counter
cbgo_seq_no_current Current acknowledged sequence number on a vBucket vbId: vBucket ID Gauge
cbgo_start_seq_no_current Current snapshot start sequence number on a vBucket vbId: vBucket ID Gauge
cbgo_end_seq_no_current Current snapshot end sequence number on a vBucket vbId: vBucket ID Gauge
cbgo_persist_seq_no_current Minimum persisted sequence number observed on a vBucket vbId: vBucket ID Gauge
cbgo_lag_current Current sequence number lag on a vBucket vbId: vBucket ID Gauge
cbgo_total_lag_current Sum of sequence number lag across assigned vBuckets N/A Gauge
cbgo_process_latency_ms_current Latest consumer event processing latency in ms N/A Gauge
cbgo_dcp_latency_ms_current Latest consumed DCP message latency in ms N/A Gauge
cbgo_process_latency_seconds Histogram of consumer event processing latency (s) N/A Histogram
cbgo_dcp_latency_seconds Histogram of end-to-end DCP delivery latency (s) N/A Histogram
cbgo_processed_bytes_total Total processed key and payload bytes by event type type: mutation/deletion/expiration Counter
cbgo_rebalance_current Total number of completed rebalances N/A Counter
cbgo_rebalancing_current Whether a rebalance is currently in progress (1/0) N/A Gauge
cbgo_rebalance_duration_ms_current Duration of the last completed rebalance in ms N/A Gauge
cbgo_unacked_event_current Current number of delivered events awaiting Ack() N/A Gauge
cbgo_stream_end_total Total organic DCP stream end events by reason reason: ok/closed/filter_empty/error Counter
cbgo_oso_snapshot_total Total completed OSO backfill snapshots N/A Counter
cbgo_prefetch_queue_events_current Current number of events queued in the prefetch buffer N/A Gauge
cbgo_prefetch_queue_bytes_current Current number of bytes held in the prefetch buffer N/A Gauge
cbgo_prefetch_queue_bytes_max Configured maximum byte capacity of the prefetch buffer N/A Gauge
cbgo_active_stream_current Current number of active vBucket streams N/A Gauge
cbgo_total_members_current Total number of members in the consumer group N/A Gauge
cbgo_member_number_current 1-based member number of this instance N/A Gauge
cbgo_membership_type_current Active membership type (value is always 1) type: membership type Gauge
cbgo_vbucket_assignment_strategy_current Effective negotiated vBucket assignment strategy (1) strategy: consistent/range Gauge
cbgo_vbucket_count_current Total number of vBuckets in the bucket N/A Gauge
cbgo_assigned_vbucket_count_current Number of vBuckets assigned to this member N/A Gauge
cbgo_vbucket_range_start_current First vBucket ID in this member's assigned range N/A Gauge
cbgo_vbucket_range_end_current Last vBucket ID in this member's assigned range N/A Gauge
cbgo_membership_dead_pruned_total Total dead member entries pruned (Couchbase membership) N/A Counter
cbgo_membership_self_reregister_total Total self re-registrations after eviction/missing doc N/A Counter
cbgo_membership_error_total Total Couchbase membership operation errors by op op: heartbeat/monitor/prune/register Counter
cbgo_offset_write_current Number of dirty vBucket offsets written in last commit N/A Gauge
cbgo_offset_write_latency_ms_current Latency of the last checkpoint write attempt in ms N/A Gauge
cbgo_checkpoint_save_total Total checkpoint save attempts by status status: success/error Counter
cbgo_checkpoint_corrupted_reset_total Total corrupted checkpoint resets to seqNo 0 N/A Counter
cbgo_collection_event_total Cluster-deduplicated scope & collection lifecycle event counts type: collection_created/deleted/flushed/modified, scope_created/deleted Counter
cbgo_collection_manifest_uid_current Latest observed Couchbase collection manifest UID N/A Gauge
cbgo_active_collection_count_current Current number of active tracked collections N/A Gauge
Compatibility
Go DCP Version Minimum Couchbase Server Version
x<1.1.16 6.5.x
1.1.16>=x 5.x.x
  • On Couchbase Server 6.5.0+, go-dcp automatically enables UseExpiryOpcode and memd.DcpOpenFlagIncludeDeleteTimes so expired documents arrive as models.DcpExpiration (and deletions carry delete timestamps). Older servers emit expirations as models.DcpDeletion.
  • On Couchbase Server 7.2.0+ with Magma buckets, DCP change streams are enabled by default unless dcp.config.disableChangeStreams: true.

Breaking Changes

Date taking effect Version Change How to check
December 14, 2023 v1.1.19 dcp.config.[DisableExpiryOpcode,DisableStreamEndByClient, EnableChangeStreams] removed Review your configs
Unreleased next Replaced zerolog with Go standard library log/slog: logger.Set, logger.New, logger.ParseLevel, dcp.NewDcpWithLogger, and dcp.NewTypedDcpWithLogger now use *slog.Logger / slog.Level. Migrate custom zerolog.Logger usages to *slog.Logger
Examples
Testing
  • Unit tests (with race detector):
    make test
    
  • Live 3-node Couchbase integration tests (stop/resume, finite mode, dynamic/couchbase membership, rebalance, rollback, hard & graceful failover, collections/deletions/expirations, ephemeral buckets, async batching):
    make create-cluster version=7.6.5
    cd test/integration && CB_REQUIRE_CLUSTER=true go test -v -race -count=1 -timeout=20m -run "^(TestCouchbase|TestIntegration_)" .
    make delete-cluster
    
    Override cluster targets with CB_HOSTS, CB_USERNAME, and CB_PASSWORD. When CB_REQUIRE_CLUSTER is unset and no cluster is reachable, integration tests skip cleanly.
  • Kubernetes HA (kubernetesHa + gRPC bidi/mTLS) kind integration tests:
    kind create cluster --name go-dcp-ha --kubeconfig /tmp/kind-kubeconfig --wait 120s
    docker build -f test/k8s/Dockerfile -t go-dcp-k8s-ha-test:local .
    kind load docker-image go-dcp-k8s-ha-test:local --name go-dcp-ha
    KUBECONFIG=/tmp/kind-kubeconfig K8S_REQUIRE_CLUSTER=true go test -v -race -tags=k8s_integration -count=1 -timeout=10m ./test/k8s
    kind delete cluster --name go-dcp-ha
    

Grafana Metric Dashboard

Grafana & Prometheus Example

Distributed Tracing

otel-go-dcp

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleConsumer added in v1.2.4

func NewSimpleConsumer(listener models.Listener) models.Consumer

Types

type Dcp

type Dcp interface {
	WaitUntilReady() chan struct{}
	Start()
	Close()
	Commit()
	GetClient() couchbase.Client
	GetConfig() *config.Dcp
	GetVersion() *couchbase.Version
	SetMetadata(metadata metadata.Metadata)
	SetMetricCollectors(collectors ...prometheus.Collector)
	SetEventHandler(handler models.EventHandler)
	SetSystemEventHandler(handler models.SystemEventHandler)
}

func NewDcp

func NewDcp(cfg any, listener models.Listener) (Dcp, error)

NewDcp creates a new Dcp client

config: path to a configuration file or a configuration struct listener is a callback function that will be called when a mutation, deletion or expiration event occurs

func NewDcpWithLogger added in v1.1.0

func NewDcpWithLogger(cfg any, listener models.Listener, log *slog.Logger) (Dcp, error)

NewDcpWithLogger creates a new Dcp client configured to log through the standard library *slog.Logger.

func NewExtendedDcp added in v1.2.4

func NewExtendedDcp(cfg any, consumer models.Consumer) (Dcp, error)

NewExtendedDcp creates a new Dcp client

config: path to a configuration file or a configuration struct consumer must implement models.Consumer interface containing both ConsumeEvent and TrackOffset methods

func NewTypedDcp added in v1.4.1

func NewTypedDcp(cfg any, consumer models.TypedConsumer) (Dcp, error)

NewTypedDcp creates a new Dcp client backed by the zero-allocation TypedConsumer fast path.

config: path to a configuration file or a configuration struct. consumer implements models.TypedConsumer (and optionally models.OffsetTracker and/or models.AcknowledgerAware for deferred Ack and manual Commit).

func NewTypedDcpWithLogger added in v1.4.1

func NewTypedDcpWithLogger(cfg any, consumer models.TypedConsumer, log *slog.Logger) (Dcp, error)

NewTypedDcpWithLogger creates a new zero-allocation TypedConsumer Dcp client configured to log through the standard library *slog.Logger.

Jump to

Keyboard shortcuts

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