Versions in this module Expand all Collapse all v0 v0.3.0 Aug 31, 2022 Changes in this version + const PathDatasetID + const PathOrgID + const PathRevision + const PathTags + var ErrAliasAlreadyCreated = errors.New("alias is already created") + var ErrAliasNotFound = errors.New("alias not found") + var ErrConfigMissingRequiredValue = errors.New("missing required configuration value") + var ErrIndexAlreadyCreated = errors.New("index already created") + var ErrIndexMappingNotValid = errors.New("parsing error in mapping") + var ErrIndexNotFound = errors.New("index not found") + type Alias struct + func (a *Alias) Create(alias, indexName string) error + func (a *Alias) Delete(name, indexName string) error + func (a *Alias) Get(name string) (indexName string, err error) + func (a *Alias) Update(name, indexName string) (oldIndexName string, err error) + type Client struct + func NewClient(cfg *Config) (*Client, error) + func (c *Client) Alias() Alias + func (c *Client) CreateDefaultMappings(orgs []domain.OrganizationConfig, withAlias, withReset bool) (indices []string, err error) + func (c *Client) GetResourceEntryStats(field string, r *http.Request) (*elastic.SearchResult, error) + func (c *Client) Indices() Indices + func (c *Client) NewBulkIndexer(orgs []domain.OrganizationConfig, workers int) (esutil.BulkIndexer, error) + func (c *Client) NewOAIPMHStore() (*OAIPMHStore, error) + func (c *Client) NewSitemapStore() *SitemapStore + func (c *Client) Ping() (*externalAPI.Response, error) + type Config struct + DisableMetrics bool + Logger *zerolog.Logger + MaxRetries int + Password string + Timeout int + Urls []string + UserName string + func DefaultConfig() *Config + func (c *Config) Valid() error + type Debug struct + func (d Debug) SearchService(s *elastic.SearchService) ([]byte, error) + type ErrorType struct + CauseReason string + CauseType string + Index string + Reason string + Type string + func GetErrorType(r io.Reader) ErrorType + func (et ErrorType) Error() error + type IndexNames struct + func (in IndexNames) FragmentIndexName(orgID string) string + func (in IndexNames) GetDigitalObjectIndexName(orgID, suffix string) string + func (in IndexNames) GetIndexName(orgID string) string + func (in IndexNames) GetSuggestIndexName(orgID string) string + func (in IndexNames) GetV1IndexName(orgID string) string + type Indices struct + func (idx *Indices) Create(alias, mapping string, withAlias bool) (indexName string, err error) + func (idx *Indices) Delete(indexName string) error + func (idx *Indices) List() ([]string, error) + func (idx *Indices) Switch(alias, newIndexName string, deleteOldIndex bool) (oldIndexName string, err error) + func (idx Indices) Exists(indexName string) error + type OAIPMHStore struct + ResponseSize int + func (o *OAIPMHStore) GetRecord(ctx context.Context, q *oaipmh.RequestConfig) (record oaipmh.Record, errors []oaipmh.Error, err error) + func (o *OAIPMHStore) ListIdentifiers(ctx context.Context, q *oaipmh.RequestConfig) (res oaipmh.Resumable, err error) + func (o *OAIPMHStore) ListMetadataFormats(ctx context.Context, q *oaipmh.RequestConfig) (formats []oaipmh.MetadataFormat, err error) + func (o *OAIPMHStore) ListRecords(ctx context.Context, q *oaipmh.RequestConfig) (res oaipmh.Resumable, err error) + func (o *OAIPMHStore) ListSets(ctx context.Context, q *oaipmh.RequestConfig) (res oaipmh.Resumable, err error) + type Proxy struct + func NewProxy(es *Client) (*Proxy, error) + func (p *Proxy) SafeHTTP(w http.ResponseWriter, r *http.Request) + func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (p *Proxy) SetLogger(log *zerolog.Logger) + type QueryBuilder struct + func NewQueryBuilder(defaultFields ...QueryField) *QueryBuilder + func (qb *QueryBuilder) NewElasticQuery(q *search.QueryTerm) elastic.Query + type QueryField struct + Boost float64 + Field string + type Response = externalAPI.Response + type SitemapStore struct + func (s *SitemapStore) Datasets(ctx context.Context, cfg sitemap.Config) ([]sitemap.Location, error) + func (s *SitemapStore) LocationCount(ctx context.Context, cfg sitemap.Config) (int, error) + func (s *SitemapStore) Locations(ctx context.Context, cfg sitemap.Config, start, end int) []sitemap.Location