Skip to main content
Glama
Southclaws

Storyden

by Southclaws
node.go1.55 kB
package simplesearch import ( "context" "github.com/Southclaws/dt" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fctx" "github.com/Southclaws/storyden/app/resources/account" "github.com/Southclaws/storyden/app/resources/datagraph" "github.com/Southclaws/storyden/app/resources/library" "github.com/Southclaws/storyden/app/resources/library/node_search" "github.com/Southclaws/storyden/app/resources/pagination" "github.com/Southclaws/storyden/app/resources/tag/tag_ref" "github.com/Southclaws/storyden/app/services/search/searcher" ) type nodeSearcher struct { node_search node_search.Search } func (s *nodeSearcher) Search(ctx context.Context, query string, p pagination.Parameters, opts searcher.Options) (*pagination.Result[datagraph.Item], error) { o := []node_search.Option{ node_search.WithNameContains(query), node_search.WithContentContains(query), } opts.Authors.Call(func(value []account.AccountID) { o = append(o, node_search.WithAuthors(value...)) }) opts.Tags.Call(func(value []tag_ref.Name) { o = append(o, node_search.WithTags(value...)) }) rs, err := s.node_search.Search(ctx, p, o...) if err != nil { return nil, fault.Wrap(err, fctx.With(ctx)) } items := dt.Map(rs.Items, func(r *library.Node) datagraph.Item { return r }) result := pagination.ConvertPageResult(*rs, items) return &result, nil } func (s *nodeSearcher) MatchFast(ctx context.Context, q string, limit int, opts searcher.Options) (datagraph.MatchList, error) { return nil, searcher.ErrFastMatchesUnavailable }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server