Перейти к содержимому

gRPC API

Это содержимое пока не доступно на вашем языке.

The network API is defined only by api/proto/stream/v1/stream.proto. Generated Go files live beside that source using source-relative protobuf generation.

  • stream.v1.StreamService: AppendToStream, ReadStream, ReadAll, Subscribe
  • stream.v1.AdminService: VerifyStorage, GetStreamInfo, ListStreams, GetStorageStatus, CalculateStreamSize, CreateBackup, ListBackups, GetBackup, UploadBackup, ListRemoteBackups, ListTenants, GetTenantUsage, UnsupportedMaintenance
  • stream.v1.SchemaService: RegisterSchema, GetSchema, ListSchemas, ValidateEvent
  • stream.v1.SubscriptionService: durable subscription lifecycle, pull/ack/nack, pause/resume/replay, dead letters
  • stream.v1.ProjectionService: projection lifecycle, rebuild, verify, stalled/errors/dead-letters
  • stream.v1.IntegrationService: ExportStream, ExportAll, ImportEvents, NATS bridge status/replay
  • stream.v1.ClusterService: GetClusterStatus, GetNodeStatus, AddNode, RemoveNode, PromoteNode, PushSnapshot
  • stream.v1.ReplicationService: AppendEntries, RequestVote, Heartbeat, InstallSnapshot (cluster mode)
  • stream.v1.AuthService: bootstrap/login/users/roles/audit
  • grpc.health.v1.Health: standard health checks

UnsupportedMaintenance always returns Unimplemented for operations that are not part of the current release (for example retention/scavenge).

Default listen address is :2113. Plaintext is the default. TLS can be enabled on both sides with matching certificates.

client, err := client.Dial(ctx, client.Config{Address: "127.0.0.1:2113"})

When auth is enabled, pass a bearer token via client config/Login; all stream, admin, schema, subscription, projection, and auth RPCs attach it.

expected_version semantics:

  • -2: stream must not exist
  • -1: accept any current version
  • >= 0: current stream version must match exactly

Optional schema name/version validate the payload before commit. See Schema Registry.

Optional idempotency_key enables safe retries: duplicate requests with the same key and payload return idempotent_replay=true without appending again. See duplicate policy.

On register, modes none, backward, forward, and full are enforced against the latest previous version of the same schema name.

  • Transient: Subscribe server stream (catch-up then live). Optional SubscribeResponse.control reports catch-up vs live mode.
  • Durable: pull/ack/nack with persistent checkpoints; multiple clients may pull the same subscription id and receive exclusive competing claims (see subscriptions)
  • Consumer groups: CreateConsumerGroup, JoinConsumerGroup, LeaveConsumerGroup, GetConsumerGroup — fan-out partition with independent checkpoints per member (see consumer groups)

For production Go clients use pkg/client/resilience (Connect, SubscribeLive, RunDurableWorker) for NATS-style reconnect.

Builtin, CEL, and Starlark runtimes with durable checkpoints under data/projections/. See projections. JavaScript is not supported. WASM is not available in the current documented runtime set.

IntegrationService streams committed events for backup, cross-environment sync:

  • ExportStream / ExportAll — server streaming; permission stream.read
  • ImportEvents — client streaming with ImportOptions (duplicate policy, dry-run); permission stream.append
  • GetNATSBridgeStatus / ReplayNATSBridge — NATS bridge ops when CHRONACTA_NATS_URL is set

CLI writes JSONL/binary files; see export/import and NATS bridge.