Documentation ¶
Index ¶
- type Config
- type IndexName
- type IndexNameAdapter
- type Option
- type PgMapper
- type SearchAdapter
- type Store
- func (s *Store) ApplySchemaChange(ctx context.Context, newEntry *schemalog.LogEntry) error
- func (s *Store) DeleteSchema(ctx context.Context, schemaName string) error
- func (s *Store) DeleteTableDocuments(ctx context.Context, schemaName string, tableIDs []string) error
- func (s *Store) GetMapper() search.Mapper
- func (s *Store) SendDocuments(ctx context.Context, docs []search.Document) ([]search.DocumentError, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexName ¶
type IndexName interface { Name() string Version() int NameWithVersion() string SchemaName() string }
IndexName represents an opensearch index name constructed from a schema name.
type IndexNameAdapter ¶
type Option ¶
type Option func(*Store)
func WithIndexNameAdapter ¶
func WithIndexNameAdapter(a IndexNameAdapter) Option
func WithLogger ¶
func WithMapper ¶
type PgMapper ¶
type PgMapper struct {
// contains filtered or unexported fields
}
func NewPostgresMapper ¶
func NewPostgresMapper(mapper searchstore.Mapper) *PgMapper
NewPostgresMapper returns a mapper that maps between postgres and search store types
func (*PgMapper) ColumnToSearchMapping ¶
ColumnToSearchMapping maps the column on input into the equivalent search mapping
func (*PgMapper) MapColumnValue ¶
MapColumnValue maps a value emitted from PG into a value that the search store can handle. If the column is a timestamp: we need to parse it. If the column is an array of any type except json, we need to map it to a Go slice. If column type is unknown we return nil. This avoids dropping the whole record if one field type is unknown.
type SearchAdapter ¶
type SearchAdapter interface { SearchDocToBulkItem(docs search.Document) searchstore.BulkItem BulkItemsToSearchDocErrs(items []searchstore.BulkItem) []search.DocumentError RecordToLogEntry(rec map[string]any) (*schemalog.LogEntry, error) }
Adapter converts from/to search types and opensearch types
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStoreWithClient ¶
func NewStoreWithClient(client searchstore.Client) *Store