Versions in this module Expand all Collapse all v0 v0.6.1 Jul 1, 2026 v0.6.0 Jul 1, 2026 Changes in this version + var ErrNilListener = fmt.Errorf("nativewire: nil listener: %w", net.ErrClosed) + var ErrServerClosed = errors.New("nativewire: server is closed") + func AdmitClusterMutation(ctx context.Context, submitter ClusterSubmitter) error + func IsCatalogVersionMismatch(err error) bool + func WithExpectedCatalogVersion(ctx context.Context, version uint64) context.Context + func WithIdempotencyKey(ctx context.Context, key []byte) context.Context + type AckPolicy = iwire.AckPolicy + const AckFlushed + const AckRaftCommitted + const AckSynced + const AckVisible + type AppliedIndexReadBarrierProvider interface + LeaderReadBarrier func(context.Context, ClusterReadRequest) (raftcluster.AppliedIndexReadBarrier, error) + type AppliedIndexReadCoordinator struct + BarrierProvider AppliedIndexReadBarrierProvider + ReadIndexProvider raftcluster.ReadIndexProvider + ReadIndexTarget raftcluster.ReadIndexBarrier + Waiter raftcluster.AppliedIndexReadBarrierWaiter + func (c AppliedIndexReadCoordinator) CoordinateRead(ctx context.Context, request ClusterReadRequest) (ClusterReadResult, error) + type CatalogClusterRouteProvider struct + func NewCatalogClusterRouteProvider(catalog raftplacement.ResolvedCatalogV1) CatalogClusterRouteProvider + func (p CatalogClusterRouteProvider) ClusterRoute(_ context.Context, request ClusterRouteRequest) (ClusterRouteTarget, error) + type Client struct + func DialContext(ctx context.Context, network, address string) (*Client, error) + func NewClient(conn net.Conn) *Client + func NewInProcessClient(ctx context.Context, server *Server) (*Client, func() error, error) + func (c *Client) Checkpoint(ctx context.Context) error + func (c *Client) CheckpointWithAck(ctx context.Context, ack AckPolicy) error + func (c *Client) Close() error + func (c *Client) CloseCollection(ctx context.Context, handle CollectionHandle) error + func (c *Client) CreateCollection(ctx context.Context, meta collections.CollectionMeta) (collections.CollectionMeta, error) + func (c *Client) CreateIndex(ctx context.Context, collection string, def collections.IndexDefinition) (collections.CollectionMeta, error) + func (c *Client) CurrentCatalogVersion(ctx context.Context) (uint64, error) + func (c *Client) CursorClose(ctx context.Context, cursorID uint64) error + func (c *Client) CursorNext(ctx context.Context, cursorID uint64, limits CursorLimits) (DocumentsResult, error) + func (c *Client) CursorNextWithOptions(ctx context.Context, cursorID uint64, limits CursorLimits, opts ReadOptions) (DocumentsResult, error) + func (c *Client) DeleteBatch(ctx context.Context, collection string, ids [][]byte, ack AckPolicy) (int, error) + func (c *Client) DropIndex(ctx context.Context, collection, index string) (collections.CollectionMeta, error) + func (c *Client) FlushAll(ctx context.Context) error + func (c *Client) FlushAllWithAck(ctx context.Context, ack AckPolicy) error + func (c *Client) FlushCollection(ctx context.Context, collection string) error + func (c *Client) FlushCollectionWithAck(ctx context.Context, collection string, ack AckPolicy) error + func (c *Client) GetMany(ctx context.Context, collection string, ids [][]byte) ([][]byte, []bool, error) + func (c *Client) GetManyHandle(ctx context.Context, handle CollectionHandle, ids [][]byte) ([][]byte, []bool, error) + func (c *Client) GetManyHandleWithOptions(ctx context.Context, handle CollectionHandle, ids [][]byte, opts ReadOptions) (DocumentsResult, error) + func (c *Client) GetManyWithOptions(ctx context.Context, collection string, ids [][]byte, opts ReadOptions) (DocumentsResult, error) + func (c *Client) Goaway(ctx context.Context) error + func (c *Client) Hello(ctx context.Context) error + func (c *Client) IndexLookup(ctx context.Context, collection, index string, value any, limits CursorLimits) ([][]byte, bool, error) + func (c *Client) IndexLookupWithOptions(ctx context.Context, collection, index string, value any, limits CursorLimits, ...) (IDResult, error) + func (c *Client) IndexRange(ctx context.Context, collection, index string, opts IndexRange) ([][]byte, bool, error) + func (c *Client) IndexRangeWithOptions(ctx context.Context, collection, index string, opts IndexRange, ...) (IDResult, error) + func (c *Client) InsertBatch(ctx context.Context, collection string, format collections.DocumentFormat, ...) ([][]byte, error) + func (c *Client) InsertBatchHandle(ctx context.Context, handle CollectionHandle, ...) ([][]byte, error) + func (c *Client) InsertBatchHandleNoResult(ctx context.Context, handle CollectionHandle, ...) error + func (c *Client) InsertBatchNoResult(ctx context.Context, collection string, format collections.DocumentFormat, ...) error + func (c *Client) ListCollections(ctx context.Context) ([]collections.CollectionMeta, error) + func (c *Client) ListIndexes(ctx context.Context, collection string) ([]collections.IndexDefinition, error) + func (c *Client) OpenCollection(ctx context.Context, name string) (CollectionHandle, error) + func (c *Client) OpenScan(ctx context.Context, collection string, limits CursorLimits) (DocumentsResult, error) + func (c *Client) OpenScanWithOptions(ctx context.Context, collection string, limits CursorLimits, opts ReadOptions) (DocumentsResult, error) + func (c *Client) Ping(ctx context.Context) error + func (c *Client) ReplaceBatch(ctx context.Context, collection string, format collections.DocumentFormat, ...) (matched, modified int, err error) + func (c *Client) Stats(ctx context.Context) (map[string]string, error) + func (c *Client) UpdateBSONSet(ctx context.Context, collection string, id []byte, ...) (matched, modified int, err error) + func (c *Client) UpdateBSONSetHandle(ctx context.Context, handle CollectionHandle, id []byte, ...) (matched, modified int, err error) + type ClusterAdmissionProvider interface + ClusterAdmissionStatus func(ctx context.Context) (ClusterAdmissionStatus, error) + type ClusterAdmissionStatus struct + Leader bool + LeaderHint string + Reason string + Unavailable bool + func ClusterFollowerAdmission(leaderHint, reason string) ClusterAdmissionStatus + func ClusterLeaderAdmission() ClusterAdmissionStatus + func ClusterUnavailableAdmission(reason string) ClusterAdmissionStatus + type ClusterReadCoordinator interface + CoordinateRead func(ctx context.Context, request ClusterReadRequest) (ClusterReadResult, error) + type ClusterReadRequest struct + CommandID iwire.CommandID + CommandName string + Policy ConsistencyPolicy + RequestID uint64 + StreamID uint64 + type ClusterReadResult struct + ActualConsistency ConsistencyPolicy + AppliedIndex uint64 + HasAppliedIndex bool + LeaderNode string + ServingNode string + type ClusterRequestMetadata = raftentry.RequestMetadataV1 + type ClusterRouteProvider interface + ClusterRoute func(ctx context.Context, request ClusterRouteRequest) (ClusterRouteTarget, error) + type ClusterRouteRequest struct + Catalog string + Collection string + CommandID iwire.CommandID + CommandName string + Database string + Shape ClusterRouteShape + Token uint64 + TokenKnown bool + Tokens []uint64 + type ClusterRouteShape string + const ClusterRouteShapeCollection + const ClusterRouteShapeToken + const ClusterRouteShapeTokenBatch + type ClusterRouteTarget struct + GroupID string + LeaderHint string + Members []string + PartitionID string + PlacementMode string + Reason string + Shape ClusterRouteShape + Token uint64 + TokenBatchClass string + TokenKnown bool + func PreflightClusterRoute(ctx context.Context, submitter ClusterSubmitter, request ClusterRouteRequest) (ClusterRouteTarget, bool, error) + type ClusterSubmitResult struct + ActualAck AckPolicy + CatalogVersion uint64 + CommittedRecoverable bool + HasCatalogVersion bool + ResponseSections []iwire.Section + type ClusterSubmitter interface + SubmitCommandEntryV1 func(ctx context.Context, entry []byte, metadata ClusterRequestMetadata) (ClusterSubmitResult, error) + type CollectionHandle uint64 + type ConsistencyPolicy = iwire.ConsistencyPolicy + const ConsistencyLeaderRead + const ConsistencyLeaseRead + const ConsistencyLinearizable + const ConsistencyLocalStale + type CursorLimits struct + MaxBytes int + MaxItems int + type CursorMeta struct + Bytes int + CursorID uint64 + HasMore bool + Items int + type DocumentsResult struct + Cursor CursorMeta + Docs [][]byte + IDs [][]byte + Present []bool + ReadMeta ReadMetadata + Truncated bool + type IDResult struct + IDs [][]byte + ReadMeta ReadMetadata + Truncated bool + type IndexRange struct + Limit int + Lower Scalar + LowerInclusive bool + LowerUnbounded bool + MaxBytes int + Upper Scalar + UpperInclusive bool + UpperUnbounded bool + type RaftClusterSubmitter struct + Bridge *raftcluster.SingleGroupSubmitter + Collections *collections.CollectionManager + func NewRaftClusterSubmitter(bridge *raftcluster.SingleGroupSubmitter, ...) *RaftClusterSubmitter + func (s *RaftClusterSubmitter) ClusterAdmissionStatus(ctx context.Context) (ClusterAdmissionStatus, error) + func (s *RaftClusterSubmitter) SubmitCommandEntryV1(ctx context.Context, entry []byte, metadata ClusterRequestMetadata) (ClusterSubmitResult, error) + type ReadMetadata struct + ActualConsistency ConsistencyPolicy + AppliedIndex uint64 + HasAppliedIndex bool + LeaderNode string + ServingNode string + Valid bool + type ReadOptions struct + ConsistencyPolicy ConsistencyPolicy + type RoutedRaftClusterSubmitter struct + RouteProvider ClusterRouteProvider + func NewRoutedRaftClusterSubmitter(bridge *raftcluster.SingleGroupSubmitter, provider ClusterRouteProvider, ...) *RoutedRaftClusterSubmitter + func (s *RoutedRaftClusterSubmitter) ClusterRoute(ctx context.Context, request ClusterRouteRequest) (ClusterRouteTarget, error) + type Scalar struct + Type collections.IndexValueType + Value any + type Server struct + func NewServer(opts ServerOptions) *Server + func (s *Server) Close() error + func (s *Server) Serve(ctx context.Context, ln net.Listener) error + func (s *Server) ServeConn(ctx context.Context, conn net.Conn) error + func (s *Server) Stats() map[string]string + type ServerOptions struct + Backend *backenddb.DB + ClusterReadCoordinator ClusterReadCoordinator + ClusterSubmitter ClusterSubmitter + Collections *collections.CollectionManager + CursorIdleTimeout time.Duration + DefaultAckPolicy iwire.AckPolicy + DefaultCursorBatchSize int + InsertBatchCombineDrainYields int + InsertBatchCombineMaxBatch int + Limits iwire.Limits + MaxCachedCollections int + MaxCollectionHandles int + MaxConnections int + MaxCursorRetainedBytes int + MaxInFlight int + MaxMetadataIdempotencyEntries int + MaxOpenCursors int + MaxScanDocuments int + type Stats map[string]string + type WireError struct + Code iwire.ErrorCode + Message string + Retryable bool + func (e *WireError) Error() string