Versions in this module Expand all Collapse all v0 v0.8.0 Jun 7, 2026 Changes in this version + const ErrCodeBadFrame + const ErrCodeNotStandby + const ErrCodeOK + const ErrCodeServerInternal + const ErrCodeUnknownMarket + const OpSnapshotReq + const OpSnapshotResp + const OpWALFrame + const OpWALFrameAck + const ReplicaClientType + type AckError struct + Code uint8 + TXID ltx.TXID + func (e *AckError) Error() string + type Dispatcher interface + Register func(reqOp, respOp uint16, h Handler) error + type FrameSink interface + Apply func(ctx context.Context, id MarketID, txid ltx.TXID, r io.Reader) error + Snapshot func(ctx context.Context, id MarketID, fromTXID ltx.TXID) (io.ReadCloser, ltx.TXID, error) + type Handler func(ctx context.Context, peer string, payload []byte) (response []byte, _ error) + type MarketID [8]byte + func DecodeSnapshotResp(msg *zap.Message) (uint8, MarketID, uint64, []byte, error) + func MarketIDFromBytes(b []byte) MarketID + type Node interface + Call func(ctx context.Context, peerID string, msg *zap.Message) (*zap.Message, error) + type Option func(*ReplicaClient) + func WithLogger(l *slog.Logger) Option + func WithTimeout(d time.Duration) Option + type ReplicaClient struct + func NewReplicaClient(node Node, peerID string, marketID MarketID, opts ...Option) *ReplicaClient + func (c *ReplicaClient) Close() error + func (c *ReplicaClient) DeleteAll(ctx context.Context) error + func (c *ReplicaClient) DeleteLTXFiles(ctx context.Context, a []*ltx.FileInfo) error + func (c *ReplicaClient) Init(ctx context.Context) error + func (c *ReplicaClient) LTXFiles(ctx context.Context, level int, seek ltx.TXID, useMetadata bool) (ltx.FileIterator, error) + func (c *ReplicaClient) MarketID() MarketID + func (c *ReplicaClient) OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, offset, size int64) (io.ReadCloser, error) + func (c *ReplicaClient) PeerID() string + func (c *ReplicaClient) SetLogger(logger *slog.Logger) + func (c *ReplicaClient) Type() string + func (c *ReplicaClient) WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error) + type Server struct + func NewServer(sink FrameSink, opts ...ServerOption) *Server + func (s *Server) Close() error + func (s *Server) Register(d Dispatcher) error + type ServerOption func(*Server) + func WithServerLogger(l *slog.Logger) ServerOption