Versions in this module Expand all Collapse all v1 v1.0.0 Oct 10, 2026 Changes in this version + const CollectionBalances + const CollectionIdentities + const CollectionLedgers + const CollectionReconciliations + const CollectionTransactions + var ErrMemoryBackpressure = errors.New("typesense memory backpressure") + var ErrReindexClosed = errors.New("reindex service is closed") + var ErrReindexInProgress = errors.New("a reindex operation is already in progress") + var ErrReindexNotStarted = errors.New("no reindex operation has been started") + func IsMemoryBackpressure(err error) bool + func MarkMemoryBackpressure(err error) error + func NormalizeTransactionDocument(data map[string]interface{}) map[string]interface + func TryReindexIfNeeded(ctx context.Context, client *TypesenseClient, ds ReindexRepository) + type CollectionConfig struct + BigIntFields []string + DefaultSortField string + IDField string + Schema *api.CollectionSchema + TimeFields []string + type IndexBatch struct + CreatedAt time.Time + Dependencies []IndexItem + ID string + Primary *IndexItem + func NewIndexBatch(id string) *IndexBatch + func (b *IndexBatch) AddDependency(collection, documentID string, data interface{}) + func (b *IndexBatch) Deduplicate() + func (b *IndexBatch) SetPrimary(collection, documentID string, data interface{}) + type IndexItem struct + Collection string + Data interface{} + DocumentID string + type MultiSearchRequest struct + Searches []api.MultiSearchSearchesParameter + type NotificationPayload struct + Data map[string]interface{} + Table string + type ReindexConfig struct + BackpressureRetryInterval time.Duration + BatchSize int + type ReindexJobs struct + func NewReindexJobs(client *TypesenseClient, repository ReindexRepository, ...) *ReindexJobs + func (j *ReindexJobs) Close() + func (j *ReindexJobs) Progress() (ReindexProgress, error) + func (j *ReindexJobs) Start(batchSize int) (ReindexProgress, error) + func (j *ReindexJobs) TryReindexIfNeeded(ctx context.Context) + type ReindexProgress struct + CompletedAt *time.Time + Errors []string + PauseReason string + Paused bool + PausedAt *time.Time + Phase string + ProcessedRecords int64 + StartedAt time.Time + Status string + TotalRecords int64 + type ReindexRepository interface + GetAllBalances func(int, int) ([]model.Balance, error) + GetAllIdentitiesPaginated func(int, int) ([]model.Identity, error) + GetAllLedgers func(int, int) ([]model.Ledger, error) + GetAllTransactions func(context.Context, int, int) ([]model.Transaction, error) + type ReindexService struct + func NewReindexService(client *TypesenseClient, datasource ReindexRepository, config ReindexConfig) *ReindexService + func (r *ReindexService) GetProgress() ReindexProgress + func (r *ReindexService) GetProgressPtr() *ReindexProgress + func (r *ReindexService) StartReindex(ctx context.Context) (*ReindexProgress, error) + type TypesenseClient struct + Client *typesense.Client + func NewTypesenseClient(apiKey string, hosts []string) *TypesenseClient + func (t *TypesenseClient) CreateCollection(ctx context.Context, schema *api.CollectionSchema) (*api.CollectionResponse, error) + func (t *TypesenseClient) DropAllCollections(ctx context.Context) error + func (t *TypesenseClient) DropCollection(ctx context.Context, collectionName string) error + func (t *TypesenseClient) EnsureCollectionsExist(ctx context.Context) error + func (t *TypesenseClient) HandleBatchNotification(ctx context.Context, batch *IndexBatch) error + func (t *TypesenseClient) HandleNotification(ctx context.Context, table string, data map[string]interface{}) error + func (t *TypesenseClient) MigrateTypeSenseSchema(ctx context.Context, collectionName string) error + func (t *TypesenseClient) MultiSearch(ctx context.Context, searchRequests api.MultiSearchSearchesParameter) (*api.MultiSearchResult, error) + func (t *TypesenseClient) Search(ctx context.Context, collection string, ...) (*api.SearchResult, error)