Versions in this module Expand all Collapse all v0 v0.15.1 Aug 16, 2024 v0.15.0 Jul 8, 2024 v0.14.0 Apr 24, 2024 Changes in this version + type Tracer struct + func TracerHook(tracer opentracing.Tracer) *Tracer + func (t *Tracer) After(ctx context.Context, afterContext AfterContext) context.Context + func (t *Tracer) Before(ctx context.Context, before BeforeContext) context.Context v0.13.0 Feb 27, 2024 Changes in this version + const FxGroup + const PropertiesPrefix + const UnknownCommand + var BulkIndexer = bulkCfgExt + var CmdToString = map[CommandType]string + var ErrCreatingNewClient = errors.New("unable to create opensearch client") + var ErrIndexNotFound = errors.New("index not found") + var Index = indexExt + var IndicesCreate = indicesCreateExt + var IndicesDelete = indicesDeleteExt + var IndicesDeleteAlias = indicesDeleteAlias + var IndicesDeleteIndexTemplate = indicesDeleteIndexTemplate + var IndicesGet = indicesGetExt + var IndicesPutAlias = indicesPutAlias + var IndicesPutIndexTemplate = indicesPutIndexTemplate + var Module = &bootstrap.Module + var Ping = pingExt + var Search = searchExt + var SearchTemplate = searchTemplateExt + func MakeConfig(options ...func(*opensearchutil.BulkIndexerConfig)) *opensearchutil.BulkIndexerConfig + func NewConfig(ctx *bootstrap.ApplicationContext, di configDI) (opensearch.Config, error) + func UnmarshalResponse[T any](resp *opensearchapi.Response) (*T, error) + func Use() + func WithClient(c *opensearch.Client) func(*opensearchutil.BulkIndexerConfig) + type AfterContext struct + Err *error + Options interface{} + Resp *opensearchapi.Response + func (c *AfterContext) CommandType() CommandType + type AfterHook interface + After func(ctx context.Context, after AfterContext) context.Context + type AfterHookBase struct + F func(ctx context.Context, after AfterContext) context.Context + Identifier string + func (s AfterHookBase) After(ctx context.Context, after AfterContext) context.Context + func (s AfterHookBase) ID() string + type AfterHookFunc func(ctx context.Context, after AfterContext) context.Context + func (f AfterHookFunc) After(ctx context.Context, after AfterContext) context.Context + type BeforeContext struct + Options interface{} + func (c *BeforeContext) CommandType() CommandType + type BeforeHook interface + Before func(ctx context.Context, before BeforeContext) context.Context + type BeforeHookBase struct + F func(ctx context.Context, after BeforeContext) context.Context + Identifier string + func (s BeforeHookBase) Before(ctx context.Context, before BeforeContext) context.Context + func (s BeforeHookBase) ID() string + type BeforeHookFunc func(ctx context.Context, before BeforeContext) context.Context + func (f BeforeHookFunc) Before(ctx context.Context, before BeforeContext) context.Context + type BulkAction string + const BulkActionCreate + const BulkActionDelete + const BulkActionIndex + const BulkActionUpdate + type CommandType int + const CmdBulk + const CmdIndex + const CmdIndicesCreate + const CmdIndicesDelete + const CmdIndicesDeleteAlias + const CmdIndicesDeleteIndexTemplate + const CmdIndicesGet + const CmdIndicesPutAlias + const CmdIndicesPutIndexTemplate + const CmdPing + const CmdSearch + const CmdSearchTemplate + func (c CommandType) String() string + type HealthIndicator struct + func NewHealthIndicator(client OpenClient) *HealthIndicator + func (i *HealthIndicator) Health(c context.Context, options health.Options) health.Health + func (i *HealthIndicator) Name() string + type Identifier interface + ID func() string + type IndicesDetail struct + Aliases map[string]interface{} + Mappings map[string]interface{} + Settings struct{ ... } + type OpenClient interface + AddAfterHook func(hook AfterHook) + AddBeforeHook func(hook BeforeHook) + BulkIndexer func(ctx context.Context, action BulkAction, bulkItems [][]byte, ...) (opensearchutil.BulkIndexer, error) + Index func(ctx context.Context, index string, body io.Reader, ...) (*opensearchapi.Response, error) + IndicesCreate func(ctx context.Context, index string, ...) (*opensearchapi.Response, error) + IndicesDelete func(ctx context.Context, index []string, ...) (*opensearchapi.Response, error) + IndicesDeleteAlias func(ctx context.Context, index []string, name []string, ...) (*opensearchapi.Response, error) + IndicesDeleteIndexTemplate func(ctx context.Context, name string, ...) (*opensearchapi.Response, error) + IndicesGet func(ctx context.Context, index string, ...) (*opensearchapi.Response, error) + IndicesPutAlias func(ctx context.Context, index []string, name string, ...) (*opensearchapi.Response, error) + IndicesPutIndexTemplate func(ctx context.Context, name string, body io.Reader, ...) (*opensearchapi.Response, error) + Ping func(ctx context.Context, o ...Option[opensearchapi.PingRequest]) (*opensearchapi.Response, error) + RemoveAfterHook func(hook AfterHook) + RemoveBeforeHook func(hook BeforeHook) + Search func(ctx context.Context, o ...Option[opensearchapi.SearchRequest]) (*opensearchapi.Response, error) + SearchTemplate func(ctx context.Context, body io.Reader, ...) (*opensearchapi.Response, error) + func NewClient(di newClientDI) (OpenClient, error) + type OpenClientImpl struct + func (c *OpenClientImpl) AddAfterHook(hook AfterHook) + func (c *OpenClientImpl) AddBeforeHook(hook BeforeHook) + func (c *OpenClientImpl) BulkIndexer(ctx context.Context, action BulkAction, documents [][]byte, ...) (opensearchutil.BulkIndexer, error) + func (c *OpenClientImpl) Index(ctx context.Context, index string, body io.Reader, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesCreate(ctx context.Context, index string, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesDelete(ctx context.Context, index []string, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesDeleteAlias(ctx context.Context, index []string, name []string, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesDeleteIndexTemplate(ctx context.Context, name string, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesGet(ctx context.Context, index string, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesPutAlias(ctx context.Context, index []string, name string, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) IndicesPutIndexTemplate(ctx context.Context, name string, body io.Reader, ...) (*opensearchapi.Response, error) + func (c *OpenClientImpl) Ping(ctx context.Context, o ...Option[opensearchapi.PingRequest]) (*opensearchapi.Response, error) + func (c *OpenClientImpl) RemoveAfterHook(hook AfterHook) + func (c *OpenClientImpl) RemoveBeforeHook(hook BeforeHook) + func (c *OpenClientImpl) Search(ctx context.Context, o ...Option[opensearchapi.SearchRequest]) (*opensearchapi.Response, error) + func (c *OpenClientImpl) SearchTemplate(ctx context.Context, body io.Reader, ...) (*opensearchapi.Response, error) + type Option func(request *T) + type Properties struct + Addresses []string + Password string + TLS TLS + Username string + func BindOpenSearchProperties(ctx *bootstrap.ApplicationContext) *Properties + func NewOpenSearchProperties() *Properties + type Repo interface + AddAfterHook func(hook AfterHook) + AddBeforeHook func(hook BeforeHook) + BulkIndexer func(ctx context.Context, action BulkAction, bulkItems *[]T, ...) (opensearchutil.BulkIndexerStats, error) + Index func(ctx context.Context, index string, document T, ...) error + IndicesCreate func(ctx context.Context, index string, mapping interface{}, ...) error + IndicesDelete func(ctx context.Context, index []string, ...) error + IndicesDeleteAlias func(ctx context.Context, index []string, name []string, ...) error + IndicesDeleteIndexTemplate func(ctx context.Context, name string, ...) error + IndicesGet func(ctx context.Context, index string, ...) (*IndicesDetail, error) + IndicesPutAlias func(ctx context.Context, index []string, name string, ...) error + IndicesPutIndexTemplate func(ctx context.Context, name string, body interface{}, ...) error + Ping func(ctx context.Context, o ...Option[opensearchapi.PingRequest]) error + RemoveAfterHook func(hook AfterHook) + RemoveBeforeHook func(hook BeforeHook) + Search func(ctx context.Context, dest *[]T, body interface{}, ...) (int, error) + SearchTemplate func(ctx context.Context, dest *[]T, body interface{}, ...) (int, error) + func NewRepo[T any](model *T, client OpenClient) Repo[T] + type RepoImpl struct + func (c *RepoImpl[T]) AddAfterHook(hook AfterHook) + func (c *RepoImpl[T]) AddBeforeHook(hook BeforeHook) + func (c *RepoImpl[T]) BulkIndexer(ctx context.Context, action BulkAction, bulkItems *[]T, ...) (opensearchutil.BulkIndexerStats, error) + func (c *RepoImpl[T]) Index(ctx context.Context, index string, document T, ...) error + func (c *RepoImpl[T]) IndicesCreate(ctx context.Context, index string, mapping interface{}, ...) error + func (c *RepoImpl[T]) IndicesDelete(ctx context.Context, index []string, ...) error + func (c *RepoImpl[T]) IndicesDeleteAlias(ctx context.Context, index []string, name []string, ...) error + func (c *RepoImpl[T]) IndicesDeleteIndexTemplate(ctx context.Context, name string, ...) error + func (c *RepoImpl[T]) IndicesGet(ctx context.Context, index string, ...) (*IndicesDetail, error) + func (c *RepoImpl[T]) IndicesPutAlias(ctx context.Context, index []string, name string, ...) error + func (c *RepoImpl[T]) IndicesPutIndexTemplate(ctx context.Context, name string, body interface{}, ...) error + func (c *RepoImpl[T]) Ping(ctx context.Context, o ...Option[opensearchapi.PingRequest]) error + func (c *RepoImpl[T]) RemoveAfterHook(hook AfterHook) + func (c *RepoImpl[T]) RemoveBeforeHook(hook BeforeHook) + func (c *RepoImpl[T]) Search(ctx context.Context, dest *[]T, body interface{}, ...) (hits int, err error) + func (c *RepoImpl[T]) SearchTemplate(ctx context.Context, dest *[]T, body interface{}, ...) (hits int, err error) + type Request interface + type SearchResponse struct + Hits struct{ ... } + Shards struct{ ... } + TimedOut bool + Took int + type TLS struct + Certs certs.SourceProperties + Enable bool