MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / WithReplicas

Function WithReplicas

pkg/cache/cache.go:89–91  ·  view source on GitHub ↗

WithReplicas sets the number of JetStream KV replicas for the NATS bucket. Defaults to 1 if not set. Set to match the cluster size (e.g. 3) for production NATS clusters. Ignored for in-memory backend.

(n int)

Source from the content-addressed store, hash-verified

87// Defaults to 1 if not set. Set to match the cluster size (e.g. 3) for
88// production NATS clusters. Ignored for in-memory backend.
89func WithReplicas(n int) Option {
90 return func(c *config) { c.replicas = n }
91}
92
93// WithReconnect provides a channel that signals NATS reconnection events.
94func WithReconnect(ch <-chan struct{}) Option {

Callers 3

NewFunction · 0.92
NewFunction · 0.92
TestNATSKV_WithReplicasFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestNATSKV_WithReplicasFunction · 0.68