Documentation
¶
Index ¶
- type Adapter
- type Config
- type IndexName
- type Mapper
- type Option
- 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 Adapter ¶
type Adapter interface {
SchemaNameToIndex(schemaName string) IndexName
IndexToSchemaName(index string) string
SearchDocToBulkItem(docs search.Document) es.BulkItem
BulkItemsToSearchDocErrs(items []es.BulkItem) []search.DocumentError
RecordToLogEntry(rec map[string]any) (*schemalog.LogEntry, error)
}
Adapter converts from/to search types and opensearch 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 Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
func NewPostgresMapper ¶
func NewPostgresMapper() *Mapper
NewPostgresMapper returns a mapper that maps between postgres and opensearch types
func (*Mapper) ColumnToSearchMapping ¶
ColumnToSearchMapping maps the column on input into the equivalent search mapping
func (*Mapper) MapColumnValue ¶
MapColumnValue maps a value emitted from PG into a value that OS 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 Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStoreWithClient ¶
func NewStoreWithClient(client es.SearchClient) *Store
func (*Store) ApplySchemaChange ¶
func (*Store) DeleteSchema ¶
func (*Store) DeleteTableDocuments ¶
func (*Store) SendDocuments ¶
Click to show internal directories.
Click to hide internal directories.