Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
22
cloud/maplepress-backend/pkg/search/provider.go
Normal file
22
cloud/maplepress-backend/pkg/search/provider.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package search
|
||||
|
||||
import (
|
||||
"codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/config"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// ProvideClient provides a Meilisearch client
|
||||
func ProvideClient(cfg *config.Config, logger *zap.Logger) (*Client, error) {
|
||||
searchConfig := NewConfig(
|
||||
cfg.Meilisearch.Host,
|
||||
cfg.Meilisearch.APIKey,
|
||||
cfg.Meilisearch.IndexPrefix,
|
||||
)
|
||||
|
||||
client, err := NewClient(searchConfig, logger)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return client, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue