ingest

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Live added in v0.0.11

type Live interface {
	AfterCommit(ctx context.Context, rows []logstore.Row)
	AfterUncertainCommit(scopes []logstore.Scope)
}

type Options

type Options struct {
	Connection              *natsconn.NatsConnection
	Pool                    *pgxpool.Pool
	Writer                  Writer
	Live                    Live
	StreamMaxBytes          int64 // Zero preserves an existing finite limit; new streams default to 1 GiB.
	AckWait                 time.Duration
	AllowRetentionMigration bool // Only after backup/preflight and stopping all old writers.
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service owns every fetched message until commit/ACK, rejection or shutdown. DB and NATS connections are borrowed; their owner closes them after Shutdown.

func Open

func Open(ctx context.Context, opts Options) (*Service, error)

Open validates options and prepares durable broker state synchronously.

func (*Service) Run

func (s *Service) Run(ctx context.Context) (err error)

Run is called once. Canceling ctx is a hard stop; use Shutdown to drain first.

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Shutdown stops new pulls, commits accepted work and waits before borrowed connections may close. Deadline expiration cancels DB calls, then joins Run.

type Writer added in v0.0.11

type Writer interface {
	// On success, return one result per event in input order. A result describes
	// an inserted event, a duplicate, or a rejected client. Writers must honor
	// ctx; shutdown waits for their active call to exit.
	Commit(ctx context.Context, logs []logstore.Event) ([]logstore.Result, error)
}

Jump to

Keyboard shortcuts

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