Documentation ¶
Index ¶
- func New(client *Client, cfg *Config) index.Index
- type Client
- type ClientConfig
- type Config
- type Index
- func (i *Index) Delete(ctx context.Context, id string) error
- func (i *Index) Get(ctx context.Context, id string, dst interface{}, fields ...string) (bool, error)
- func (i *Index) Index(ctx context.Context, id string, properties interface{}) error
- func (i *Index) String() string
- func (i *Index) Update(ctx context.Context, id string, properties interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { *instr.Instrumentation // contains filtered or unexported fields }
Client for search index.
func NewClient ¶
func NewClient(cfg *ClientConfig, i *instr.Instrumentation) (*Client, error)
NewClient returns a configured search index, or an error.
type ClientConfig ¶
type ClientConfig struct { URL string Transport http.RoundTripper Debug bool BulkIndexerWorkers int BulkIndexerFlushBytes int BulkIndexerFlushTimeout time.Duration BulkGetterBatchSize int BulkGetterBatchTimeout time.Duration }
ClientConfig configures search index.
type Config ¶
type Config struct {
Name string
}
Config represents the configuration for an OpenSearch index.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index wraps an OpenSearch index to store documents
func (*Index) Get ¶
func (i *Index) Get(ctx context.Context, id string, dst interface{}, fields ...string) (bool, error)
Get retreives `fields` from document with `id` from the index, returning: - (true, decoding_error) if found (decoding error set when errors in json) - (false, nil) when not found - (false, error) otherwise
Click to show internal directories.
Click to hide internal directories.